Skip to content

Commit

Permalink
Merge pull request ibmruntimes#749 from keithc-ca/get_source
Browse files Browse the repository at this point in the history
Update get_source.sh
  • Loading branch information
pshipton committed Apr 26, 2024
2 parents 6bc6c60 + 4bd537d commit 140062d
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions get_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -139,35 +136,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#*=}"
Expand All @@ -187,7 +159,7 @@ process_options() {
break
;;
*)
# bad option
fail "Unknown option: '$arg'"
usage
;;
esac
Expand Down Expand Up @@ -224,7 +196,7 @@ clone_or_update_repos() {
cd - > /dev/null
else
echo
echo "Clone repository: $folder"
echo "Cloning $folder version $branch from $url"
echo

git clone \
Expand Down

0 comments on commit 140062d

Please sign in to comment.