logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git
commit: ad581198fe041c0fc6167839979ee9e59530128c
parent ebb12deb7a65e564d356ce56c85121c7f07cfffa
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  3 Apr 2024 08:39:51 +0200

sys-devel/gettext: autopoint: Fix unescaped parenthesis

Diffstat:

Asys-devel/gettext/files/gettext-0.3.2-autopoint-parenthesis.patch41+++++++++++++++++++++++++++++++++++++++++
Dsys-devel/gettext/gettext-0.3.2-r2.ebuild56--------------------------------------------------------
Asys-devel/gettext/gettext-0.3.2-r3.ebuild57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 98 insertions(+), 56 deletions(-)

diff --git a/sys-devel/gettext/files/gettext-0.3.2-autopoint-parenthesis.patch b/sys-devel/gettext/files/gettext-0.3.2-autopoint-parenthesis.patch @@ -0,0 +1,41 @@ +From 86d9b993d0e09d8f8788dcd18c308206a199a82a Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> +Date: Sun, 21 Jan 2024 08:57:33 +0100 +Subject: [PATCH] =?UTF-8?q?autopoint:=20Fix=20unescaped=20parenthesis=20in?= + =?UTF-8?q?=20${=E2=80=A6}?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Upstream: https://github.com/sabotage-linux/gettext-tiny/commit/86d9b993d0e09d8f8788dcd18c308206a199a82a + +Tested against mksh 59c, dash 0.5.12 and bash 5.1_p16 on Gentoo Linux while +in zbar-0.23.92 working directory. + +A quick `git grep '${.*('` doesn't leads to other scripts with similar issues. + +Closes: https://github.com/sabotage-linux/gettext-tiny/issues/65 +--- + src/autopoint.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/autopoint.in b/src/autopoint.in +index ce41116..fd00afd 100755 +--- a/src/autopoint.in ++++ b/src/autopoint.in +@@ -15,13 +15,13 @@ dirprefix="" + while read line + do + if [ "${line##*AC_CONFIG_AUX_DIR}" != "$line" ]; then +- dirprefix="${line##*([}" +- dirprefix="${dirprefix%%])*}" ++ dirprefix="${line##*'(['}" ++ dirprefix="${dirprefix%%'])'*}" + mkdir -p "${dirprefix}" + fi + + if [ "${line##*po/Makefile.in}" != "$line" ]; then +- poprefix="${line##*[}" ++ poprefix="${line##*'['}" + poprefix="${poprefix%%po/Makefile.in*}" + install -D -m 644 @datadir@/data/autopoint_Makefile.in "./${poprefix}/po/Makefile.in.in" + fi diff --git a/sys-devel/gettext/gettext-0.3.2-r2.ebuild b/sys-devel/gettext/gettext-0.3.2-r2.ebuild @@ -1,56 +0,0 @@ -# Copyright 2022-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit toolchain-funcs - -DESCRIPTION="Stub and/or lightweight replacements of the GNU gettext suite" -HOMEPAGE="https://github.com/sabotage-linux/gettext-tiny" -SRC_URI="https://github.com/sabotage-linux/gettext-tiny/archive/refs/tags/v${PV}.tar.gz -> gettext-tiny-${PV}.tar.gz" -S="${WORKDIR}/gettext-tiny-${PV}/" - -LICENSE="MIT" -SLOT="tiny" -KEYWORDS="~amd64" -IUSE="shim" - -RDEPEND="!sys-devel/gettext:0" - -PATCHES=( - "${FILESDIR}"/${P}-respect-CFLAGS.patch - "${FILESDIR}"/${P}-xgettext-version-output.patch -) - -DOCS=( README.md docs ) - -src_prepare() { - default - - # Needs to be set early, otherwise scripts like autopoint have a wrong prefix value - sed -i "s;^prefix=.*;prefix=${EPREFIX}/usr;" Makefile || die -} - -src_compile() { - tc-export AR RANLIB CC - - emake -} - -src_install() { - local libintl_type - - if use shim ; then - if use elibc_musl ; then - libintl_type=MUSL - else - libintl_type=NOOP - fi - else - # If they don't want the shim (e.g. glibc users who have their own libintl), - # don't install a libintl and just install the binaries. - libintl_type=NONE - fi - - emake LIBINTL="${libintl_type}" DESTDIR="${D}" install -} diff --git a/sys-devel/gettext/gettext-0.3.2-r3.ebuild b/sys-devel/gettext/gettext-0.3.2-r3.ebuild @@ -0,0 +1,57 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Stub and/or lightweight replacements of the GNU gettext suite" +HOMEPAGE="https://github.com/sabotage-linux/gettext-tiny" +SRC_URI="https://github.com/sabotage-linux/gettext-tiny/archive/refs/tags/v${PV}.tar.gz -> gettext-tiny-${PV}.tar.gz" +S="${WORKDIR}/gettext-tiny-${PV}/" + +LICENSE="MIT" +SLOT="tiny" +KEYWORDS="~amd64" +IUSE="shim" + +RDEPEND="!sys-devel/gettext:0" + +PATCHES=( + "${FILESDIR}"/gettext-0.3.2-respect-CFLAGS.patch + "${FILESDIR}"/gettext-0.3.2-xgettext-version-output.patch + "${FILESDIR}"/gettext-0.3.2-autopoint-parenthesis.patch +) + +DOCS=( README.md docs ) + +src_prepare() { + default + + # Needs to be set early, otherwise scripts like autopoint have a wrong prefix value + sed -i "s;^prefix=.*;prefix=${EPREFIX}/usr;" Makefile || die +} + +src_compile() { + tc-export AR RANLIB CC + + emake +} + +src_install() { + local libintl_type + + if use shim ; then + if use elibc_musl ; then + libintl_type=MUSL + else + libintl_type=NOOP + fi + else + # If they don't want the shim (e.g. glibc users who have their own libintl), + # don't install a libintl and just install the binaries. + libintl_type=NONE + fi + + emake LIBINTL="${libintl_type}" DESTDIR="${D}" install +}