From 44a58f76882a3081eec86a7fff8ff4ebd42d00aa Mon Sep 17 00:00:00 2001 From: "Keith W. Campbell" Date: Fri, 26 Apr 2024 11:41:44 -0400 Subject: [PATCH] Update get_source.sh * improve feedback for invalid arguments * improve feedback for cloning steps * remove support for non-standard options * remove unused variables Signed-off-by: Keith W. Campbell --- get_source.sh | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/get_source.sh b/get_source.sh index 3d39994548f..afb5603b8ce 100644 --- a/get_source.sh +++ b/get_source.sh @@ -22,9 +22,6 @@ # exit immediately if any unexpected error occurs set -e -openssloptions="" -DOWNLOAD_OPENSSL=false - # These maps are keyed by the prefix of option names (e.g. openj9, omr). declare -A source_branch # branch or tag declare -A source_folder # local working directory @@ -140,35 +137,10 @@ process_options() { local version="" for arg in "$@" ; do - # temporarily handle openssl options that don't follow the general pattern - case "$arg" in - --openssl-repo=*) - # remove leading '-' - arg="${arg/--/-}" - ;; - --openssl-version=*) - # map to -openssl-branch - version="${arg#*=}" - case "$version" in - 1.0.2* | 1.1.*) - version="OpenSSL_${version//./_}" - ;; - 3.*) - version="openssl-$version" - ;; - *) - ;; - esac - arg=-openssl-branch=$version - ;; - *) - ;; - esac - if [[ "$arg" =~ -([A-Za-z0-9]+)-(branch|reference|repo|sha)=.* ]] ; then local key="${BASH_REMATCH[1]}" if [ -z "${source_folder[${key}]}" ] ; then - fail "Unknown option: $arg" + fail "Unknown option: '$arg'" fi local value="${arg#*=}" @@ -197,7 +169,7 @@ process_options() { break ;; *) - # bad option + fail "Unknown option: '$arg'" usage ;; esac @@ -234,7 +206,7 @@ clone_or_update_repos() { cd - > /dev/null else echo - echo "Clone repository: $folder" + echo "Cloning $folder version $branch from $url" echo git clone \