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

Bug 839171

Summary: sys-apps/busybox: automated shellcheck found errors
Product: Gentoo Linux Reporter: shellbugbot <d-shellbug>
Component: Current packagesAssignee: Embedded Gentoo Team <embedded>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description shellbugbot 2022-04-18 11:06:00 UTC
Shellckeck found errors in one or more shellscripts provided by sys-apps/busybox.

Kindly refer to the findings below and the shellcheck wiki for further details:

------------------------------------------------
script: /usr/portage/sys-apps/busybox/files/mdev/ide_links:6

for i in $media $media[0-9]* ; do
                
error: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). (https://github.com/koalaman/shellcheck/wiki/SC1087)

------------------------------------------------
script: /usr/portage/sys-apps/busybox/files/mdev/ide_links:20

num=`ls $media[0-9]* 2>/dev/null | wc -l`
        
error: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). (https://github.com/koalaman/shellcheck/wiki/SC1087)

------------------------------------------------
script: /usr/portage/sys-apps/busybox/files/mdev/usbdisk_link:25

elif [ -e /sys/block/*/$MDEV ] ; then
          ^^^^^^^^^^^^^^^^^^
error: -e doesn't work with globs. Use a for loop. (https://github.com/koalaman/shellcheck/wiki/SC2144)

This is an automated bug report. Conservative settings were used to minimize false-positives but there's still a chance that the above list contains non-issues.
Running shellcheck again with default settings could detect other possible issues.

References:
[1] this script: https://github.com/heeplr/gentoo-shellbug
[2] shellcheck: https://www.shellcheck.net/
Comment 1 Larry the Git Cow gentoo-dev 2022-06-30 21:41:07 UTC
The bug has been closed via the following commit(s):

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

commit aefd51cd66b73a46463563aa2a11410a93061b0d
Author:     Viorel Munteanu <ceamac.paragon@gmail.com>
AuthorDate: 2022-05-21 15:14:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-30 21:40:16 +0000

    sys-apps/busybox: fix bugs reported by shellcheck
    
    Closes: https://bugs.gentoo.org/839171
    Signed-off-by: Viorel Munteanu <ceamac.paragon@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/25062
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/busybox/files/mdev/dvbdev       |  8 +++---
 sys-apps/busybox/files/mdev/ide_links    | 20 +++++++--------
 sys-apps/busybox/files/mdev/usbdev       | 42 ++++++++++++++++----------------
 sys-apps/busybox/files/mdev/usbdisk_link | 36 +++++++++++++++------------
 4 files changed, 55 insertions(+), 51 deletions(-)