From f52facac30cbc1c8d0616b99d7de186b60059e6a Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 7 Dec 2022 16:50:04 +1100 Subject: [PATCH] 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) --- common.sh | 16 +++++++++------- final_msg | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) 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 " -- 2.39.5