Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 754987 - app-admin/openrc-settingsd uses pushd/popd to build and fails with /bin/dash
Summary: app-admin/openrc-settingsd uses pushd/popd to build and fails with /bin/dash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2020-11-17 00:51 UTC by ppdplayer
Modified: 2021-04-15 01:31 UTC (History)
3 users (show)

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


Attachments
build log (build.log,11.59 KB, text/x-log)
2020-11-17 00:51 UTC, ppdplayer
Details
remove-pushd-for-posix-conformance.patch (remove-pushd-for-posix-conformance.patch,1.27 KB, patch)
2020-11-17 22:18 UTC, Kerin Millar
Details | Diff
remove-pushd-for-posix-conformance-r1.patch (remove-pushd-for-posix-conformance-r1.patch,1.33 KB, patch)
2020-11-17 22:35 UTC, Kerin Millar
Details | Diff
build log after patch (build.log,12.43 KB, text/x-log)
2020-11-18 03:09 UTC, ppdplayer
Details
remove-pushd-for-posix-conformance-r2.patch (remove-pushd-for-posix-conformance-r2.patch,2.79 KB, patch)
2020-11-18 03:58 UTC, Kerin Millar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ppdplayer 2020-11-17 00:51:36 UTC
Created attachment 671698 [details]
build log

This package does not build due to it using the bashisms(?) pushd/popd. Was found by symlinking /bin/sh to app-shells/dash (/bin/dash).
Comment 1 Kerin Millar 2020-11-17 22:18:04 UTC
Created attachment 672085 [details, diff]
remove-pushd-for-posix-conformance.patch

The usage of both pushd and popd in the Makefile is wholly superfluous. Please try the attached patch by placing it under /etc/portage/patches/app-admin/openrc-settingsd/.
Comment 2 Kerin Millar 2020-11-17 22:35:30 UTC
Created attachment 672088 [details, diff]
remove-pushd-for-posix-conformance-r1.patch

Disregard the previous patch. Here's another that implements the equivalent logic. The difference is that cd is used to change directories, rather than pushd. There is no need to subsequently switch the directory back because, for all affected instances, the shell code is contained by parentheses and is therefore executed within a subshell. Additionally, as chdir(2) could theoretically fail, use && to verify that the operation succeeded.
Comment 3 ppdplayer 2020-11-18 03:06:14 UTC
Applied patch, and it still errors out with pushd and popd.
Comment 4 ppdplayer 2020-11-18 03:07:44 UTC
Applied patch, and it still errors out with pushd and popd.
Comment 5 ppdplayer 2020-11-18 03:09:06 UTC
Created attachment 672091 [details]
build log after patch
Comment 6 Kerin Millar 2020-11-18 03:54:09 UTC
(In reply to ppdplayer from comment #4)
> Applied patch, and it still errors out with pushd and popd.

Thanks for testing. In that case, it should have an effect if you invoke "eautoreconf" just after "default" in the src_prepare function. I'll attach another patch that saves the trouble of editing the ebuild.
Comment 7 Kerin Millar 2020-11-18 03:58:05 UTC
Created attachment 672109 [details, diff]
remove-pushd-for-posix-conformance-r2.patch

Revised to also patch the generated Makefile.in included by the tarball.
Comment 8 ppdplayer 2020-11-19 03:51:59 UTC
(In reply to Kerin Millar from comment #7)
> Created attachment 672109 [details, diff] [details, diff]
> remove-pushd-for-posix-conformance-r2.patch
> 
> Revised to also patch the generated Makefile.in included by the tarball.

The patch worked. I'd imagine that's getting thrown in the repository?
Comment 9 Larry the Git Cow gentoo-dev 2021-04-15 01:31:15 UTC
The bug has been closed via the following commit(s):

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

commit eb7a00e00ea5619385930a3893bb6c40928a2c4a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-04-15 01:24:59 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-04-15 01:31:06 +0000

    app-admin/openrc-settingsd: fix build with non-Bash
    
    Thanks-to: Kerin Millar
    Closes: https://bugs.gentoo.org/754987
    Signed-off-by: Sam James <sam@gentoo.org>

 .../openrc-settingsd-1.0.1-remove-bashisms.patch   | 81 ++++++++++++++++++++++
 .../openrc-settingsd-1.0.1-r1.ebuild               |  4 ++
 2 files changed, 85 insertions(+)