From: Stephen Rothwell Date: Wed, 7 Dec 2022 05:50:04 +0000 (+1100) Subject: common.sh: allow scripts to explicitly as for no arg parsing X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=f52facac30cbc1c8d0616b99d7de186b60059e6a;p=next-scripts common.sh: allow scripts to explicitly as for no arg parsing 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) --- diff --git a/common.sh b/common.sh index 31b3922..2d46df5 100644 --- 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}" diff --git a/final_msg b/final_msg index 0412a2e..2a940c8 100755 --- 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 " cc="Linux Kernel Mailing List "