Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 754987

Summary: app-admin/openrc-settingsd uses pushd/popd to build and fails with /bin/dash
Product: Gentoo Linux Reporter: ppdplayer
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: jstein, kfm, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=759616
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 526268    
Attachments: build log
remove-pushd-for-posix-conformance.patch
remove-pushd-for-posix-conformance-r1.patch
build log after patch
remove-pushd-for-posix-conformance-r2.patch

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 kfm 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 kfm 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 kfm 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 kfm 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(+)