Skip to content

Commit

Permalink
Add --openssl-repo option for downloading OpenSSL source
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
  • Loading branch information
pshipton committed Oct 13, 2022
1 parent 65d61b6 commit 7837ef5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
13 changes: 9 additions & 4 deletions closed/get_openssl_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@
# ===========================================================================

usage() {
echo "Usage: $0 [-h|--help] [--openssl-version=<openssl version 1.0.2 and above to download>]"
echo "Usage: $0 [-h|--help] [--openssl-repo=<repo URL>] [--openssl-version=<openssl version 1.0.2 and above to download>]"
echo "where:"
echo " -h|--help print this help, then exit"
echo " --openssl-repo OpenSSL repository. By default, https://github.com/openssl/openssl.git"
echo " --openssl-version OpenSSL version to download. For example, 1.1.1"
echo ""
exit 1
}

OPENSSL_VERSION=""
GIT_URL="https://github.com/openssl/openssl.git"
OPENSSL_URL="https://github.com/openssl/openssl.git"

for i in "$@"
do
Expand All @@ -41,6 +42,10 @@ do
usage
;;

--openssl-repo=* )
OPENSSL_URL="${i#*=}"
;;

--openssl-version=* )
OPENSSL_VERSION="${i#*=}"
;;
Expand Down Expand Up @@ -85,7 +90,7 @@ if [ -f "openssl/openssl_version.txt" ]; then
fi

echo ""
echo "Cloning OpenSSL version $OPENSSL_VERSION"
git clone --depth=1 -b $OPENSSL_SOURCE_TAG $GIT_URL
echo "Cloning OpenSSL version $OPENSSL_VERSION from $OPENSSL_URL"
git clone --depth=1 -b $OPENSSL_SOURCE_TAG $OPENSSL_URL

echo $OPENSSL_SOURCE_TAG > openssl/openssl_version.txt
7 changes: 6 additions & 1 deletion get_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

# ===========================================================================
# (c) Copyright IBM Corp. 2017, 2021 All Rights Reserved
# (c) Copyright IBM Corp. 2017, 2022 All Rights Reserved
# ===========================================================================

# exit immediately if any unexpected error occurs
Expand All @@ -47,6 +47,7 @@ usage() {
echo " -omr-sha a commit SHA for the omr repository"
echo " -omr-reference a local repo to use as a clone reference"
echo " -parallel (boolean) if 'true' then the clone j9 repository commands run in parallel, default is false"
echo " --openssl-repo Specify the OpenSSL repository to download from"
echo " --openssl-version Specify the version of OpenSSL source to download"
echo ""
exit 1
Expand All @@ -66,6 +67,10 @@ for i in "$@" ; do
j9options="${j9options} ${i}"
;;

--openssl-repo=* )
openssloptions="${openssloptions} ${i}"
;;

--openssl-version=* )
DOWNLOAD_OPENSSL=true
openssloptions="${openssloptions} ${i}"
Expand Down

0 comments on commit 7837ef5

Please sign in to comment.