Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 715202 - sys-libs/libsmbios with app-shells/dash: /bin/sh: 3: Bad substitution
Summary: sys-libs/libsmbios with app-shells/dash: /bin/sh: 3: Bad substitution
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2020-03-28 23:14 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2021-01-04 19:12 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,53.85 KB, text/plain)
2020-03-28 23:14 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details
libsmbios-avoid-indirect-expansion-in-shell.patch (libsmbios-avoid-indirect-expansion-in-shell.patch,1.96 KB, patch)
2021-01-03 10:55 UTC, kfm
Details | Diff
libsmbios-avoid-indirect-expansion-in-shell-r1.patch (libsmbios-avoid-indirect-expansion-in-shell-r1.patch,2.00 KB, patch)
2021-01-03 11:06 UTC, kfm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-03-28 23:14:15 UTC
Created attachment 626620 [details]
build.log

for var in GETTEXT_PACKAGE PACKAGE_VERSION PACKAGE localedir libdir libexecdir datadir sysconfdir pythondir pkgpythondir pkgdatadir pkgconfdir pkggladedir pkglibexecdir LIBSMBIOS_C_SONAME clidir __VERSION__  ;\
do      \
        perl -p -i -e "s|^$var\s*=.*|$var=\"${!var}\"|"  src/python/_vars.py;\
done
/bin/sh: 3: Bad substitution
make: *** [Makefile:3147: src/python/_vars.py] Error 2
 * ERROR: sys-libs/libsmbios-2.4.3::gentoo failed (compile phase):
 *   emake failed
Comment 1 Michael Orlitzky gentoo-dev 2020-03-29 00:32:35 UTC
That's not during ./configure, it's just a regular old bashism in ${!var}.
Comment 2 Larry the Git Cow gentoo-dev 2020-11-30 08:59:20 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a0d04363b570d0802e74b9e28acc1e5482f0a37

commit 2a0d04363b570d0802e74b9e28acc1e5482f0a37
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2020-11-30 08:58:56 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2020-11-30 08:59:16 +0000

    sys-libs/libsmbios: set CONFIG_SHELL="/bin/bash"
    
    until upstream provides a POSIX compliant configure file.
    
    Bug: https://bugs.gentoo.org/715202
    Package-Manager: Portage-3.0.11, Repoman-3.0.2
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-libs/libsmbios/libsmbios-2.4.3.ebuild | 1 +
 1 file changed, 1 insertion(+)
Comment 3 kfm 2021-01-03 10:55:30 UTC
Created attachment 680836 [details, diff]
libsmbios-avoid-indirect-expansion-in-shell.patch

I believe that this patch should do the trick. Please note that it should be applied in addition to https://github.com/dell/libsmbios/commit/97b4bdc, which addresses the misuse of == in a test elsewhere.
Comment 4 kfm 2021-01-03 11:06:34 UTC
Created attachment 680839 [details, diff]
libsmbios-avoid-indirect-expansion-in-shell-r1.patch

Exactly the same as the previous patch, only it directly exports 'var'. This is for simplicity and so as to render the patch more comfortable for upstreaming.
Comment 5 kfm 2021-01-03 11:14:15 UTC
I don't have a GitHub account so if anyone feels like mentioning the patch at https://github.com/dell/libsmbios/issues/89 then please do.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-01-04 00:05:32 UTC
Thank you very much. I've filed a pull request at GitHub.
Comment 7 Larry the Git Cow gentoo-dev 2021-01-04 00:07:10 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45f9fe12cea15385fd80353c45990ed66fd5ce6d

commit 45f9fe12cea15385fd80353c45990ed66fd5ce6d
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2021-01-04 00:06:40 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2021-01-04 00:07:07 +0000

    sys-libs/libsmbios: Avoid bashisms
    
    Thanks-to: Kerin Millar <kfm@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@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(-)
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-01-04 19:12:10 UTC
Merged upstream.