public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lars Wendler" <polynomial-c@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/
Date: Mon,  4 Jan 2021 00:07:11 +0000 (UTC)	[thread overview]
Message-ID: <1609718827.45f9fe12cea15385fd80353c45990ed66fd5ce6d.polynomial-c@gentoo> (raw)

commit:     45f9fe12cea15385fd80353c45990ed66fd5ce6d
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  4 00:06:40 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jan  4 00:07:07 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45f9fe12

sys-libs/libsmbios: Avoid bashisms

Thanks-to: Kerin Millar <kfm <AT> plushkava.net>
Bug: https://bugs.gentoo.org/715202
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../files/libsmbios-2.4.3-avoid_bashisms.patch     | 84 ++++++++++++++++++++++
 sys-libs/libsmbios/libsmbios-2.4.3.ebuild          |  4 +-
 2 files changed, 86 insertions(+), 2 deletions(-)

diff --git a/sys-libs/libsmbios/files/libsmbios-2.4.3-avoid_bashisms.patch b/sys-libs/libsmbios/files/libsmbios-2.4.3-avoid_bashisms.patch
new file mode 100644
index 00000000000..eb26ba8dca4
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.4.3-avoid_bashisms.patch
@@ -0,0 +1,84 @@
+From 97b4bdc042c48001132200828fe32c08cf9265e7 Mon Sep 17 00:00:00 2001
+From: Joe Dight <17280110+joedight@users.noreply.github.com>
+Date: Fri, 27 Nov 2020 20:14:24 +0000
+Subject: [PATCH 1/2] Fix configure.ac bashism
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index e14ec4a..6db254f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -116,7 +116,7 @@ AC_PROG_INSTALL
+ 
+ dnl Check for python support
+ AM_CONDITIONAL([HAVE_PYTHON], [false])
+-if test x$wantpython == xyes ; then
++if test x$wantpython = xyes ; then
+     AM_PATH_PYTHON([3.0],,[:])
+     AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
+ fi
+-- 
+2.30.0
+
+
+From fb7585222503c48f35270ee148ad3fef762a7502 Mon Sep 17 00:00:00 2001
+From: Kerin Millar <kfm@plushkava.net>
+Date: Mon, 4 Jan 2021 00:57:29 +0100
+Subject: [PATCH 2/2] Don't rely on support for indirect expansion in the shell
+
+POSIX does not define the indirect expansion syntax. Moreover, if going
+to the trouble of executing Perl, one may as well take full advantage of
+it. Address the issue by first having the shell export the variable.
+Next, have Perl perform the replacement without utilising any form of
+code injection. Instead, export 'var' into Perl's environment. That
+way, Perl can reference the variable name as $ENV{var} and its value as
+$ENV{$ENV{var}}.
+
+Signed-off-by: Kerin Millar <kfm@plushkava.net>
+Closes: https://bugs.gentoo.org/715202
+Closes: https://github.com/dell/libsmbios/issues/89
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Makefile-std           | 4 ++--
+ src/python/Makefile.am | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile-std b/Makefile-std
+index 7ac6fa2..dd30d68 100644
+--- a/Makefile-std
++++ b/Makefile-std
+@@ -38,7 +38,7 @@ install-data-hook:
+ 	    file=$(DESTDIR)/$$i                     ;\
+ 	    for var in $(REPLACE_VARS)	;\
+ 	    do	\
+-	        perl -p -i -e "s|^$$var\s*=.*|$$var=\"$${!var}\"|"  $$file;\
++	        var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|'  $$file;\
+ 	    done	;\
+ 	done
+ 
+@@ -48,7 +48,7 @@ install-exec-hook:
+ 	    file=$(DESTDIR)/$$i                     ;\
+ 	    for var in $(REPLACE_VARS)	;\
+ 	    do	\
+-	        perl -p -i -e "s|^$$var\s*=.*|$$var=\"$${!var}\"|"  $$file;\
++	        var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|'  $$file;\
+ 	    done	;\
+ 	done
+ 
+diff --git a/src/python/Makefile.am b/src/python/Makefile.am
+index 693b6d9..6aca968 100644
+--- a/src/python/Makefile.am
++++ b/src/python/Makefile.am
+@@ -29,5 +29,5 @@ src/python/_vars.py: src/python/libsmbios_c/_vars.py  configure Makefile config.
+ 	cp $< $@
+ 	for var in $(REPLACE_VARS)	;\
+ 	do	\
+-		perl -p -i -e "s|^$$var\s*=.*|$$var=\"$${!var}\"|"  $@;\
++		var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|'  $@;\
+ 	done
+-- 
+2.30.0
+

diff --git a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
index 867d00becf2..201ab1d33e8 100644
--- a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
+++ b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -31,6 +31,7 @@ DEPEND="${RDEPEND}
 
 PATCHES=(
 	"${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+	"${FILESDIR}/${PN}-2.4.3-avoid_bashisms.patch" #715202
 )
 
 pkg_setup() {
@@ -57,7 +58,6 @@ src_configure() {
 		$(use_enable python)
 		$(use_enable static-libs static)
 	)
-	CONFIG_SHELL="/bin/bash" \
 	econf "${myeconfargs[@]}"
 }
 


             reply	other threads:[~2021-01-04  0:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04  0:07 Lars Wendler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-07 14:30 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/ Marek Szuba
2023-09-07 10:20 Marek Szuba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1609718827.45f9fe12cea15385fd80353c45990ed66fd5ce6d.polynomial-c@gentoo \
    --to=polynomial-c@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox