From 560402c3dc6d355b66c821f6c36df7c85f1b44be Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 25 Feb 2021 08:50:09 +0100 Subject: [PATCH] style: shfmt pre correction --- dracut-bash-completion.sh | 3 +- dracut-catimages.sh | 2 +- dracut.sh | 4 +- lsinitrd-bash-completion.sh | 5 +- modules.d/00systemd/module-setup.sh | 2 +- modules.d/02systemd-networkd/module-setup.sh | 9 ++-- .../90dmsquash-live/dmsquash-live-root.sh | 7 ++- modules.d/95iscsi/module-setup.sh | 14 +++--- modules.d/98dracut-systemd/module-setup.sh | 2 +- test/TEST-02-SYSTEMD/systemd-analyze.sh | 13 ++--- test/TEST-04-FULL-SYSTEMD/test.sh | 7 +-- test/TEST-99-RPM/test.sh | 48 +++++++++---------- 12 files changed, 61 insertions(+), 55 deletions(-) diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh index 21dac0e1..9fbd5558 100644 --- a/dracut-bash-completion.sh +++ b/dracut-bash-completion.sh @@ -32,8 +32,7 @@ _dracut() { --xz --zstd --no-compress --gzip --list-modules --show-modules --keep --printsize --regenerate-all --noimageifnotneeded --early-microcode --no-early-microcode --print-cmdline --reproducible --uefi' - - [ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers + [ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers --omit-drivers --modules --omit --drivers --filesystems --install --fwdir --libdirs --fscks --add-fstab --mount --device --nofscks --kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix diff --git a/dracut-catimages.sh b/dracut-catimages.sh index c3c4d094..a7d75636 100755 --- a/dracut-catimages.sh +++ b/dracut-catimages.sh @@ -30,7 +30,7 @@ derror() { } usage() { -# 80x25 linebreak here ^ + # 80x25 linebreak here ^ cat << EOF Usage: $0 [OPTION]... [...] Creates initial ramdisk image by concatenating several images from the command diff --git a/dracut.sh b/dracut.sh index cb729f03..f716f7bb 100755 --- a/dracut.sh +++ b/dracut.sh @@ -45,7 +45,7 @@ usage() { . "$dracutbasedir"/dracut-version.sh fi -# 80x25 linebreak here ^ + # 80x25 linebreak here ^ cat << EOF Usage: $dracut_cmd [OPTION]... [ []] @@ -71,7 +71,7 @@ long_usage() { . "$dracutbasedir"/dracut-version.sh fi -# 80x25 linebreak here ^ + # 80x25 linebreak here ^ cat << EOF Usage: $dracut_cmd [OPTION]... [ []] diff --git a/lsinitrd-bash-completion.sh b/lsinitrd-bash-completion.sh index 9532bb79..a86da868 100644 --- a/lsinitrd-bash-completion.sh +++ b/lsinitrd-bash-completion.sh @@ -24,9 +24,8 @@ __contains_word () { _lsinitrd() { local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( - [STANDALONE]='-s --size -h --help' - - [ARG]='-f --file -k --kver' + [STANDALONE]='-s --size -h --help' + [ARG]='-f --file -k --kver' ) # shellcheck disable=SC2086 diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh index 16f7f728..e57da5d9 100755 --- a/modules.d/00systemd/module-setup.sh +++ b/modules.d/00systemd/module-setup.sh @@ -242,7 +242,7 @@ install() { rescue.target \ systemd-ask-password-console.service \ systemd-ask-password-plymouth.service \ - ; do + ${NULL}; do [[ -f "$systemdsystemunitdir"/$i ]] || continue $SYSTEMCTL -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service done diff --git a/modules.d/02systemd-networkd/module-setup.sh b/modules.d/02systemd-networkd/module-setup.sh index ae853c74..a09ad830 100755 --- a/modules.d/02systemd-networkd/module-setup.sh +++ b/modules.d/02systemd-networkd/module-setup.sh @@ -49,17 +49,18 @@ install() { # grep '^systemd-timesync:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group" _arch=${DRACUT_ARCH:-$(uname -m)} - inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \ + inst_libdir_file \ + {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_resolve.so.*" + # systemd-timesyncd.service for i in \ systemd-networkd-wait-online.service \ systemd-networkd.service \ - systemd-networkd.socket -# systemd-timesyncd.service - do + systemd-networkd.socket \ + ${NULL}; do $SYSTEMCTL -q --root "$initdir" enable "$i" done } diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh index b1cf4ae4..0f6ceb6a 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root.sh +++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh @@ -64,7 +64,12 @@ det_img_fs() { modprobe squashfs CMDLINE=$(getcmdline) -for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done +for arg in $CMDLINE; do + case $arg in + ro | rw) liverw=$arg ;; + esac +done + # mount the backing of the live image first mkdir -m 0755 -p /run/initramfs/live if [ -f $livedev ]; then diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh index 8bd86d0c..43a1dd9d 100755 --- a/modules.d/95iscsi/module-setup.sh +++ b/modules.d/95iscsi/module-setup.sh @@ -225,16 +225,16 @@ install() { iscsiadm iscsid for i in \ - iscsid.socket \ - iscsiuio.socket \ - ; do + iscsid.socket \ + iscsiuio.socket \ + ${NULL}; do $SYSTEMCTL -q --root "$initdir" enable "$i" done - + for i in \ - iscsid.service \ - iscsiuio.service \ - ; do + iscsid.service \ + iscsiuio.service \ + ${NULL}; do $SYSTEMCTL -q --root "$initdir" add-wants basic.target "$i" done diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh index 0e5cd7ab..e0adf992 100755 --- a/modules.d/98dracut-systemd/module-setup.sh +++ b/modules.d/98dracut-systemd/module-setup.sh @@ -47,7 +47,7 @@ install() { dracut-pre-pivot.service \ dracut-pre-trigger.service \ dracut-pre-udev.service \ - ; do + ${NULL}; do inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}" $SYSTEMCTL -q --root "$initdir" add-wants initrd.target "$i" done diff --git a/test/TEST-02-SYSTEMD/systemd-analyze.sh b/test/TEST-02-SYSTEMD/systemd-analyze.sh index ff6f02f1..05bc8aa4 100755 --- a/test/TEST-02-SYSTEMD/systemd-analyze.sh +++ b/test/TEST-02-SYSTEMD/systemd-analyze.sh @@ -4,12 +4,13 @@ cp /usr/bin/true /usr/bin/man for i in \ sysinit.target \ - basic.target \ - initrd-fs.target \ - initrd.target \ - initrd-switch-root.target \ - emergency.target \ - shutdown.target; do + basic.target \ + initrd-fs.target \ + initrd.target \ + initrd-switch-root.target \ + emergency.target \ + shutdown.target \ + ${NULL}; do if ! systemd-analyze verify $i; then warn "systemd-analyze verify $i failed" poweroff diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index 82e6c01d..dcd6d043 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -172,9 +172,10 @@ EOF # install basic keyboard maps and fonts for i in \ /usr/lib/kbd/consolefonts/eurlatgr* \ - /usr/lib/kbd/keymaps/{legacy/,/}include/* \ - /usr/lib/kbd/keymaps/{legacy/,/}i386/include/* \ - /usr/lib/kbd/keymaps/{legacy/,/}i386/qwerty/us.*; do + /usr/lib/kbd/keymaps/{legacy/,/}include/* \ + /usr/lib/kbd/keymaps/{legacy/,/}i386/include/* \ + /usr/lib/kbd/keymaps/{legacy/,/}i386/qwerty/us.* \ + ${NULL}; do [[ -f $i ]] || continue inst $i done diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh index 244bde1a..ec03de07 100755 --- a/test/TEST-99-RPM/test.sh +++ b/test/TEST-99-RPM/test.sh @@ -68,30 +68,30 @@ test_run() { #!/bin/bash set -x export LC_MESSAGES=C -rpm -Va |& \ - grep -F \ - '85-display-manager.preset| /run| /var| /usr/lib/variant| /etc/machine-id| /etc/systemd/system/dbus-org.freedesktop.network1.service| /etc/systemd/system/dbus-org.freedesktop.resolve1.service| /etc/udev/hwdb.bin| /usr/share/info/dir.old' \ - &> /test.output - -find / -xdev -type f -not -path '/var/*' \ - -not -path '/usr/lib/modules/*/modules.*' \ - -not -path '/etc/*-' \ - -not -path '/etc/.pwd.lock' \ - -not -path '/run/mount/utab' \ - -not -path '/test.sh' \ - -not -path '/test.output' \ - -not -path '/etc/nsswitch.conf.bak' \ - -not -path '/etc/iscsi/initiatorname.iscsi' \ - -not -path '/boot/*0-rescue*' \ - -not -path '/usr/share/mime/*' \ - -not -path '/etc/crypto-policies/*' \ - -not -path '/dev/null' \ - -not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \ - -not -path "/boot/\$(cat /etc/machine-id)/*" \ - -not -path '/etc/openldap/certs/*' \ - -not -path '/etc/dnf/*' \ - -print0 | xargs -0 rpm -qf | \ - grep -F 'not owned' &>> /test.output || : +rpm -Va 2>&1 | \\ + grep -F \\ + '85-display-manager.preset| /run| /var| /usr/lib/variant| /etc/machine-id| /etc/systemd/system/dbus-org.freedesktop.network1.service| /etc/systemd/system/dbus-org.freedesktop.resolve1.service| /etc/udev/hwdb.bin| /usr/share/info/dir.old' \\ + &> /test.output + +find / -xdev -type f -not -path '/var/*' \\ + -not -path '/usr/lib/modules/*/modules.*' \\ + -not -path '/etc/*-' \\ + -not -path '/etc/.pwd.lock' \\ + -not -path '/run/mount/utab' \\ + -not -path '/test.sh' \\ + -not -path '/test.output' \\ + -not -path '/etc/nsswitch.conf.bak' \\ + -not -path '/etc/iscsi/initiatorname.iscsi' \\ + -not -path '/boot/*0-rescue*' \\ + -not -path '/usr/share/mime/*' \\ + -not -path '/etc/crypto-policies/*' \\ + -not -path '/dev/null' \\ + -not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \\ + -not -path "/boot/\$(cat /etc/machine-id)/*" \\ + -not -path '/etc/openldap/certs/*' \\ + -not -path '/etc/dnf/*' \\ + -print0 | xargs -0 rpm -qf | \\ + grep -F 'not owned' &>> /test.output || : exit 0 EOF