On 10/27/2014 04:59 PM, Anders Darander wrote:
* Chong Lu <chong...@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
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to