ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
8d419f
From 52f6eedb3bb4dc7a57fea6a8991b9058dedc8edc Mon Sep 17 00:00:00 2001
8d419f
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
8d419f
Date: Thu, 16 Dec 2021 14:37:53 +0100
8d419f
Subject: [PATCH] kernel-install: fix shellcheck
8d419f
8d419f
(cherry picked from commit 0bb1cb1fce5ebf307501dec1679e37f0c0157be9)
8d419f
8d419f
Related: #2065061
8d419f
---
8d419f
 src/kernel-install/kernel-install | 22 +++++++++++-----------
8d419f
 1 file changed, 11 insertions(+), 11 deletions(-)
8d419f
8d419f
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
8d419f
index b358b03b2f..f6da0cf7a8 100755
8d419f
--- a/src/kernel-install/kernel-install
8d419f
+++ b/src/kernel-install/kernel-install
8d419f
@@ -26,8 +26,8 @@ usage()
8d419f
     echo "  $0 [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE ...]"
8d419f
     echo "  $0 [OPTIONS...] remove KERNEL-VERSION"
8d419f
     echo "Options:"
8d419f
-    echo "  -h,--help     Print this help"
8d419f
-    echo "  -v,--verbose  Increase verbosity"
8d419f
+    echo "  -h, --help     Print this help"
8d419f
+    echo "  -v, --verbose  Increase verbosity"
8d419f
 }
8d419f
 
8d419f
 dropindirs_sort()
8d419f
@@ -58,15 +58,15 @@ dropindirs_sort()
8d419f
 
8d419f
 export LC_COLLATE=C
8d419f
 
8d419f
-for i in "$@"; do
8d419f
-    if [ "$i" == "--help" -o "$i" == "-h" ]; then
8d419f
+for i; do
8d419f
+    if [ "$i" = "--help" ] || [ "$i" = "-h" ]; then
8d419f
         usage
8d419f
         exit 0
8d419f
     fi
8d419f
 done
8d419f
 
8d419f
 KERNEL_INSTALL_VERBOSE=0
8d419f
-if [ "$1" == "--verbose" -o "$1" == "-v" ]; then
8d419f
+if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then
8d419f
     shift
8d419f
     KERNEL_INSTALL_VERBOSE=1
8d419f
 fi
8d419f
@@ -185,13 +185,13 @@ case $COMMAND in
8d419f
         for f in "${PLUGINS[@]}"; do
8d419f
             if [[ -x $f ]]; then
8d419f
                 [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
8d419f
-                    echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $KERNEL_IMAGE ${INITRD_OPTIONS[@]}"
8d419f
+                    echo "+$f add $KERNEL_VERSION $ENTRY_DIR_ABS $KERNEL_IMAGE ${INITRD_OPTIONS[*]}"
8d419f
                 "$f" add "$KERNEL_VERSION" "$ENTRY_DIR_ABS" "$KERNEL_IMAGE" "${INITRD_OPTIONS[@]}"
8d419f
                 x=$?
8d419f
-                if [[ $x == $SKIP_REMAINING ]]; then
8d419f
+                if [ $x -eq "$SKIP_REMAINING" ]; then
8d419f
                     break
8d419f
                 fi
8d419f
-                ((ret+=$x))
8d419f
+                ((ret+=x))
8d419f
             fi
8d419f
         done
8d419f
         ;;
8d419f
@@ -203,10 +203,10 @@ case $COMMAND in
8d419f
                     echo "+$f remove $KERNEL_VERSION $ENTRY_DIR_ABS"
8d419f
                 "$f" remove "$KERNEL_VERSION" "$ENTRY_DIR_ABS"
8d419f
                 x=$?
8d419f
-                if [[ $x == $SKIP_REMAINING ]]; then
8d419f
+                if [ $x -eq "$SKIP_REMAINING" ]; then
8d419f
                     break
8d419f
                 fi
8d419f
-                ((ret+=$x))
8d419f
+                ((ret+=x))
8d419f
             fi
8d419f
         done
8d419f
 
8d419f
@@ -222,4 +222,4 @@ case $COMMAND in
8d419f
         ;;
8d419f
 esac
8d419f
 
8d419f
-exit $ret
8d419f
+exit "$ret"