[OE-core] [PATCH v2] Remove bashisms
Burton, Ross
ross.burton at intel.com
Thu Sep 22 10:04:55 UTC 2016
On 22 September 2016 at 10:33, <zhe.he at windriver.com> wrote:
> -if type systemctl >/dev/null 2>/dev/null; then
> +if command -p systemctl >/dev/null 2>/dev/null; then
This doesn't do what you want:
$ type whoami ; echo $?
whoami is /usr/bin/whoami
0
$ type foobar; echo $?
-bash: type: foobar: not found
1
'type' when used with a binary prints the full path (thus the redirect) and
returns success if it was found, error if it wasn't.
$ command -p whoami ; echo $?
ross
0
$ which applyotron
/home/ross/bin/applyotron
$ command -p applyotron
-bash: applyotron: command not found
'command -p' searches for a binary (ignoring any aliases or builtins) in a
hardcoded set of paths as you pass -p (not $PATH, so will fail at rootfs
time) for a binary and executes it if found. We don't want to look in a
hard-coded set of paths, and we don't want to run the binary, so these
changes are bad.
bash, dash and ash all support type, which is why verify-bashisms has them
on the whitelist as the simplest way of saying "does this binary exist".
# Remove unpackaged files (based on list in rpm.spec)
> - rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,
> rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
> + rm -f ${D}/${libdir}/rpm/Specfile.pm
> + rm -f ${D}/${libdir}/rpm/cpanflute
> + rm -f ${D}/${libdir}/rpm/cpanflute2
> + rm -f ${D}/${libdir}/rpm/rpmdiff
> + rm -f ${D}/${libdir}/rpm/rpmdiff.cgi
> + rm -f ${D}/${libdir}/rpm/sql.prov
> + rm -f ${D}/${libdir}/rpm/sql.req
> + rm -f ${D}/${libdir}/rpm/tcl.req
> + rm -f ${D}/${libdir}/rpm/trpm
>
I deleted these in "rpm: remove redundant removals" when doing a similar
sweep, so please rebase to master.
I think all thats left is the guile cleanup, so can you submit just that
with a rewritten commit message.
Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160922/e953e380/attachment-0002.html>
More information about the Openembedded-core
mailing list