]> git.ozlabs.org Git - next-scripts/commitdiff
common.sh: use "normal" conditionals
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 30 Nov 2022 05:17:47 +0000 (16:17 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 30 Nov 2022 05:17:47 +0000 (16:17 +1100)
common.sh

index 3dfda680858c56e300293cc7efca5b4ed99f6a87..947c1c2e9d9fa3bbfc1550a9a55f94b54f44f67b 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -3,13 +3,17 @@
 #
 
 # Just in case this gets included twice ...
-[ "$_next_common_included" ] && return 0
+if [ "$_next_common_included" ]; then
+       return 0
+fi
 _next_common_included=1
 
 bin_dir=$(realpath "$(dirname "$0")")
 top_dir=$(dirname "$bin_dir")
 
-[ "$LOG_FILE" ] || LOG_FILE="$top_dir/merge.log"
+if [ -z "$LOG_FILE" ]; then
+       LOG_FILE="$top_dir/merge.log"
+fi
 SHA1_FILE="$top_dir/SHA1s"
 CTRL_FILE="$top_dir/etc/control"
 
@@ -20,26 +24,38 @@ j_factor=$(nproc)
 gpg_key=89F91C0A41D5C07A
 kup_gpg_key=015042F34957D06C
 
-[ "$NEXT_BUILD_HOST" ] && {
+if [ "$NEXT_BUILD_HOST" ]; then
        build_host="$NEXT_BUILD_HOST"
-       [ "$build_host" = "none" ] && build_host=""
-}
-[ "$NEXT_BUILD_DIR" ] && build_dir="$NEXT_BUILD_DIR"
-[ "$NEXT_GCC_VERSION" ] && gcc_version="$NEXT_GCC_VERSION"
+       if [ "$build_host" = "none" ]; then
+               build_host=""
+       fi
+fi
+if [ "$NEXT_BUILD_DIR" ]; then
+       build_dir="$NEXT_BUILD_DIR"
+fi
+if [ "$NEXT_GCC_VERSION" ]; then
+       gcc_version="$NEXT_GCC_VERSION"
+fi
 gcc_ppc_version=$gcc_version
-[ "$NEXT_GCC_PPC_VERSION" ] && gcc_ppc_version="$NEXT_GCC_PPC_VERSION"
+if [ "$NEXT_GCC_PPC_VERSION" ]; then
+       gcc_ppc_version="$NEXT_GCC_PPC_VERSION"
+fi
 gcc_ppcle_version=$gcc_ppc_version
-[ "$NEXT_GCC_PPCLE_VERSION" ] && gcc_ppcle_version="$NEXT_GCC_PPCLE_VERSION"
-[ "$NEXT_J_FACTOR" ] && j_factor="$NEXT_J_FACTOR"
+if [ "$NEXT_GCC_PPCLE_VERSION" ]; then
+       gcc_ppcle_version="$NEXT_GCC_PPCLE_VERSION"
+fi
+if [ "$NEXT_J_FACTOR" ]; then
+       j_factor="$NEXT_J_FACTOR"
+fi
 
-[ -n "$1" ] && {
+if [ -n "$1" ]; then
        build_host="$1"
        shift
-}
-[ -n "$1" ] && {
+fi
+if [ -n "$1" ]; then
        build_dir="$1"
        shift
-}
+fi
 
 export NEXT_BUILD_HOST="${build_host:-none}"
 export NEXT_BUILD_DIR="$build_dir"