]> git.ozlabs.org Git - next-scripts/commitdiff
common.sh: allow scripts to explicitly as for no arg parsing
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Dec 2022 05:50:04 +0000 (16:50 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Dec 2022 05:50:04 +0000 (16:50 +1100)
Use this in final_msg so it has no bashisms left and
can be just a Posix shell script
(see https://www.shellcheck.net/wiki/SC2240)

common.sh
final_msg

index 31b39221a03a8a579f070c62270732d02e3b38c1..2d46df5ba4b41a763dccc5406df1a11cc80c2de0 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -54,13 +54,15 @@ if [ "$NEXT_J_FACTOR" ]; then
        j_factor="$NEXT_J_FACTOR"
 fi
 
-if [ -n "$1" ]; then
-       build_host="$1"
-       shift
-fi
-if [ -n "$1" ]; then
-       build_dir="$1"
-       shift
+if [ -z "$_next_common_no_args" ]; then
+       if [ -n "$1" ]; then
+               build_host="$1"
+               shift
+       fi
+       if [ -n "$1" ]; then
+               build_dir="$1"
+               shift
+       fi
 fi
 
 export NEXT_BUILD_HOST="${build_host:-none}"
index 0412a2e6ba40c15dac1828e245d6060f0bb4c60a..2a940c80d19d8950e93a2c6092debdcf7c654ffd 100755 (executable)
--- a/final_msg
+++ b/final_msg
@@ -1,7 +1,7 @@
-#!/bin/bash
+#!/bin/sh
 
 tools_dir=$(dirname "$0")
-. "$tools_dir/common.sh" ""
+_next_common_no_args=1 . "$tools_dir/common.sh"
 
 to="Linux Next Mailing List <linux-next@vger.kernel.org>"
 cc="Linux Kernel Mailing List <linux-kernel@vger.kernel.org>"