From d8a16058bf23419397fccb855ffbf44ff1afb080 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Thu, 15 Dec 2022 23:07:03 +0100 Subject: [PATCH] download_and_compile.sh: remove some unnecessary quoting Only in a few "crowded" places where this improves readability. Note that in these cases, the quote removal does *not* prevent the parameter values from containing spaces, tabs or newlines. --- download_and_compile.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/download_and_compile.sh b/download_and_compile.sh index 462f51c..defe2b6 100755 --- a/download_and_compile.sh +++ b/download_and_compile.sh @@ -1081,10 +1081,10 @@ while true; do --lts) SELECTED_SUITE=latest-lts; shift ;; --old-lts) SELECTED_SUITE=old-lts; shift ;; --component-branch) - if [[ "$2" =~ ^([-_a-zA-Z0-9]+)=(.+)$ ]]; then - verbatim_component="${BASH_REMATCH[1]}" - component="${BASH_REMATCH[1]^^}" # convert the component to uppercase - branch="${BASH_REMATCH[2]}" + if [[ $2 =~ ^([-_a-zA-Z0-9]+)=(.+)$ ]]; then + verbatim_component=${BASH_REMATCH[1]} + component=${BASH_REMATCH[1]^^} # convert the component to uppercase + branch=${BASH_REMATCH[2]} if ! _elementIn "$component" "${WHATTOBUILD_AVAIL[@]}"; then echo "Invalid component passed to option --component-branch:" \ @@ -1130,11 +1130,11 @@ while true; do shift 2 ;; --git-clone-site-params) - if [[ "$2" =~ ^([[:alnum:]]+)=([[:alpha:]]+)(:([-_.[:alnum:]]+))?$ ]]; then - site="${BASH_REMATCH[1],,}" # convert the site to lowercase - verbatim_proto="${BASH_REMATCH[2]}" - proto="${verbatim_proto,,}" # ditto for the protocol - username="${BASH_REMATCH[4]}" # but take the username verbatim + if [[ $2 =~ ^([[:alnum:]]+)=([[:alpha:]]+)(:([-_.[:alnum:]]+))?$ ]]; then + site=${BASH_REMATCH[1],,} # convert the site to lowercase + verbatim_proto=${BASH_REMATCH[2]} + proto=${verbatim_proto,,} # ditto for the protocol + username=${BASH_REMATCH[4]} # but take the username verbatim if ! _elementIn "$proto" ssh https git; then echo "Invalid protocol passed to option --git-clone-site-params:" \