ソースを参照

Shell code cleanup

Christoph Biedl 1 年間 前
コミット
f85b985af9
3 ファイル変更33 行追加34 行削除
  1. 11 11
      debian/clevis-udisks2.postinst
  2. 9 9
      debian/clevis-udisks2.postrm
  3. 13 14
      debian/tests/run-testsuite

+ 11 - 11
debian/clevis-udisks2.postinst

@@ -3,17 +3,17 @@
 set -e
 
 case "$1" in
-configure)
-    if ! getent passwd _clevis >/dev/null; then
-        adduser --quiet --system --group --no-create-home --home /nonexistent --force-badname _clevis
-    fi
-    ;;
-abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-*)
-    echo "postinst called with unknown argument '$1'" >&2
-    exit 1
-    ;;
+    configure)
+        if ! getent passwd _clevis >/dev/null; then
+            adduser --quiet --system --group --no-create-home --home /nonexistent --force-badname _clevis
+        fi
+        ;;
+    abort-upgrade | abort-remove | abort-deconfigure) ;;
+
+    *)
+        echo "postinst called with unknown argument '$1'" >&2
+        exit 1
+        ;;
 esac
 
 #DEBHELPER#

+ 9 - 9
debian/clevis-udisks2.postrm

@@ -3,15 +3,15 @@
 set -e
 
 case "$1" in
-remove)
-    deluser --quiet _clevis >/dev/null || :
-    ;;
-purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-*)
-    echo "postrm called with unknown argument '$1'" >&2
-    exit 1
-    ;;
+    remove)
+        deluser --quiet _clevis >/dev/null || :
+        ;;
+    purge | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear) ;;
+
+    *)
+        echo "postrm called with unknown argument '$1'" >&2
+        exit 1
+        ;;
 esac
 
 #DEBHELPER#

+ 13 - 14
debian/tests/run-testsuite

@@ -17,31 +17,30 @@ sed -e 's/@OLD_CRYPTSETUP@/0/' \
     <src/luks/tests/tests-common-functions.in \
     >src/luks/tests/tests-common-functions
 
-SRC="$PWD"
+src_dir="$PWD"
 
-export PATH="$SRC/src/pins/tang/tests:$PATH"
+export PATH="$src_dir/src/pins/tang/tests:$PATH"
 
-EXIT=0
+exit=0
 
-cd "$SRC/src/luks/tests"
+cd "$src_dir/src/luks/tests"
 
-for f in $(find . -type f -not -name 'tests-common-functions*' -executable | sort) ; do
-    if [ "$f" = './unbind-unbound-slot-luks2' ] ; then
+for f in $(find . -type f -not -name 'tests-common-functions*' -executable | sort); do
+    if [ "$f" = './unbind-unbound-slot-luks2' ]; then
         echo "W: Skipping test $f"
         continue
     fi
     echo "I: Running test $f"
     # test are very noisy, keep them silent as long as they pass
-    T0="$(date +%s)"
-    chronic "$f" || EXIT=$?
-    DELTA="$(( $(date +%s) - $T0 ))"
-    echo "I: ... run time: $DELTA"
+    t0="$(date +%s)"
+    chronic "$f" || exit=$?
+    delta="$(($(date +%s) - t0))"
+    echo "I: ... run time: $delta"
 done
 
-
-cd "$SRC/src/pins/tang/tests"
+cd "$src_dir/src/pins/tang/tests"
 
 echo "I: Running test pin-tang"
-chronic bash pin-tang || EXIT=$?
+chronic bash pin-tang || exit=$?
 
-exit $EXIT
+exit $exit