From: Chong Lu <Chong.Lu@windriver.com>
To: Anders Darander <anders@chargestorm.se>
Cc: "openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/1] systemd: add bash to RDEPENDS
Date: Mon, 27 Oct 2014 17:24:35 +0800 [thread overview]
Message-ID: <544E0F53.3010600@windriver.com> (raw)
In-Reply-To: <20141027085931.GA27393@ad.chargestorm.se>
On 10/27/2014 04:59 PM, Anders Darander wrote:
> * Chong Lu <Chong.Lu@windriver.com> [141027 08:19]:
>> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
>> but no providers in its RDEPENDS [file-rdeps]
> How much bashisms are it in the files in systemd-kernel-install?
> Would it be possible to to patch the scripts to use standard posixh sh
> instead of bash?
>
> It's always good/nice to not force bash to be installed.
>
> Cheers,
> Anders
>
Hi Anders,
It has lots of bashisms:
$ checkbashisms ./usr/bin/kernel-install
possible bashism in ./usr/bin/kernel-install line 32 (local -opt):
local -a files
possible bashism in ./usr/bin/kernel-install line 35 (readarray):
readarray -t files < <(
possible bashism in ./usr/bin/kernel-install line 38 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -e "$i" ]]; then
possible bashism in ./usr/bin/kernel-install line 45 (bash arrays,
${name[0|*|@]}):
for f in "${files[@]}"; do
possible bashism in ./usr/bin/kernel-install line 47 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -e "$d/$f" ]]; then
possible bashism in ./usr/bin/kernel-install line 58 (should be 'b = a'):
if [ "$i" == "--help" -o "$i" == "-h" ]; then
possible bashism in ./usr/bin/kernel-install line 58 (should be 'b = a'):
if [ "$i" == "--help" -o "$i" == "-h" ]; then
possible bashism in ./usr/bin/kernel-install line 64 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ "${0##*/}" == 'installkernel' ]]; then
possible bashism in ./usr/bin/kernel-install line 64 (should be 'b = a'):
if [[ "${0##*/}" == 'installkernel' ]]; then
possible bashism in ./usr/bin/kernel-install line 74 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/machine-id ]]; then
possible bashism in ./usr/bin/kernel-install line 78 (alternative test
command ([[ foo ]] should be [ foo ])):
if ! [[ $MACHINE_ID ]]; then
possible bashism in ./usr/bin/kernel-install line 84 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then
possible bashism in ./usr/bin/kernel-install line 92 (readarray):
readarray -t PLUGINS < <(
possible bashism in ./usr/bin/kernel-install line 100 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ ! "$KERNEL_IMAGE" ]]; then
possible bashism in ./usr/bin/kernel-install line 110 (bash arrays,
${name[0|*|@]}):
for f in "${PLUGINS[@]}"; do
possible bashism in ./usr/bin/kernel-install line 111 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -x $f ]]; then
possible bashism in ./usr/bin/kernel-install line 113 (should be
VAR="${VAR}foo"):
((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 113 ('((' should be
'$(('):
((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 119 (bash arrays,
${name[0|*|@]}):
for f in "${PLUGINS[@]}"; do
possible bashism in ./usr/bin/kernel-install line 120 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -x $f ]]; then
possible bashism in ./usr/bin/kernel-install line 122 (should be
VAR="${VAR}foo"):
((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 122 ('((' should be
'$(('):
((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 127 (should be
VAR="${VAR}foo"):
((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 127 ('((' should be
'$(('):
((ret+=$?))
$ checkbashisms ./usr/lib/kernel/install.d/50-depmod.install
possible bashism in ./usr/lib/kernel/install.d/50-depmod.install line 5
(alternative test command ([[ foo ]] should be [ foo ])):
[[ $1 == "add" ]] || exit 0
possible bashism in ./usr/lib/kernel/install.d/50-depmod.install line 5
(should be 'b = a'):
[[ $1 == "add" ]] || exit 0
possible bashism in ./usr/lib/kernel/install.d/50-depmod.install line 6
(alternative test command ([[ foo ]] should be [ foo ])):
[[ $2 ]] || exit 1
$ checkbashisms ./usr/lib/kernel/install.d/90-loaderentry.install
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 10 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/machine-id ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 14 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $MACHINE_ID ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 21 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ $COMMAND == remove ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 21 (should be 'b = a'):
if [[ $COMMAND == remove ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 25 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $COMMAND == add ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 25 (should be 'b = a'):
if ! [[ $COMMAND == add ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 29 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $KERNEL_IMAGE ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 33 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/os-release ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 35 (alternative test command ([[ foo ]] should be [ foo ])):
elif [[ -f /usr/lib/os-release ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 39 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $PRETTY_NAME ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 43 (declare):
declare -a BOOT_OPTIONS
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 45 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/kernel/cmdline ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 46 (readarray):
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 49 (bash arrays, ${name[0|*|@]}):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 49 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 50 (read with option other than -r):
read -ar line < /proc/cmdline
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 51 (bash arrays, ${name[0|*|@]}):
for i in "${line[@]}"; do
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 52 (alternative test command ([[ foo ]] should be [ foo ])):
[[ "${i#initrd=*}" != "$i" ]] && continue
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 53 (bash arrays, ${name[0|*|@]}):
BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 57 (bash arrays, ${name[0|*|@]}):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 57 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 79 (bash arrays, ${name[0|*|@]}):
echo "options ${BOOT_OPTIONS[*]}"
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install
line 82 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -f $BOOT_DIR_ABS/initrd ]] && \
echo "initrd $BOOT_DIR/initrd"
Best Regards
Chong
next prev parent reply other threads:[~2014-10-27 9:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 7:16 [PATCH 0/1] systemd: add bash to RDEPENDS Chong Lu
2014-10-27 7:16 ` [PATCH 1/1] " Chong Lu
2014-10-27 8:59 ` Anders Darander
2014-10-27 9:24 ` Chong Lu [this message]
2014-11-12 11:59 ` Anders Darander
2014-11-24 8:50 ` Chong Lu
2014-11-11 2:17 ` Chong Lu
2014-11-12 10:28 ` Koen Kooi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=544E0F53.3010600@windriver.com \
--to=chong.lu@windriver.com \
--cc=anders@chargestorm.se \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.