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
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C)
Depends on:
Blocks: nonbash
  Show dependency tree
Reported: 2020-03-28 23:14 UTC by Lars Wendler (Polynomial-C)
Modified: 2021-01-04 19:12 UTC (History)
3 users (show)

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

build.log (build.log,53.85 KB, text/plain)
2020-03-28 23:14 UTC, Lars Wendler (Polynomial-C)
libsmbios-avoid-indirect-expansion-in-shell.patch (libsmbios-avoid-indirect-expansion-in-shell.patch,1.96 KB, patch)
2021-01-03 10:55 UTC, Kerin Millar
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, Kerin Millar
Details | Diff

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

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/;\
/bin/sh: 3: Bad substitution
make: *** [Makefile:3147: src/python/] 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):

commit 2a0d04363b570d0802e74b9e28acc1e5482f0a37
Author:     Lars Wendler <>
AuthorDate: 2020-11-30 08:58:56 +0000
Commit:     Lars Wendler <>
CommitDate: 2020-11-30 08:59:16 +0000

    sys-libs/libsmbios: set CONFIG_SHELL="/bin/bash"
    until upstream provides a POSIX compliant configure file.
    Package-Manager: Portage-3.0.11, Repoman-3.0.2
    Signed-off-by: Lars Wendler <>

 sys-libs/libsmbios/libsmbios-2.4.3.ebuild | 1 +
 1 file changed, 1 insertion(+)
Comment 3 Kerin Millar 2021-01-03 10:55:30 UTC
Created attachment 680836 [details, diff]

I believe that this patch should do the trick. Please note that it should be applied in addition to, which addresses the misuse of == in a test elsewhere.
Comment 4 Kerin Millar 2021-01-03 11:06:34 UTC
Created attachment 680839 [details, diff]

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 Kerin Millar 2021-01-03 11:14:15 UTC
I don't have a GitHub account so if anyone feels like mentioning the patch at then please do.
Comment 6 Lars Wendler (Polynomial-C) 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):

commit 45f9fe12cea15385fd80353c45990ed66fd5ce6d
Author:     Lars Wendler <>
AuthorDate: 2021-01-04 00:06:40 +0000
Commit:     Lars Wendler <>
CommitDate: 2021-01-04 00:07:07 +0000

    sys-libs/libsmbios: Avoid bashisms
    Thanks-to: Kerin Millar <>
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Lars Wendler <>

 .../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) gentoo-dev 2021-01-04 19:12:10 UTC
Merged upstream.