From e14319ea009b988c6482400130f87a4230e59108 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 28 Oct 2020 12:13:51 -0600 Subject: [PATCH] Porting #1541 changes over to the develop branch. --- scripts/build/met_build.sh | 32 +++++++++++-------------- scripts/build/met_checkout_and_build.sh | 2 +- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/scripts/build/met_build.sh b/scripts/build/met_build.sh index fe1bab2ec3..7a73526282 100755 --- a/scripts/build/met_build.sh +++ b/scripts/build/met_build.sh @@ -9,8 +9,9 @@ # This script is called by the # MET_checkout_and_build.sh script. # -# The desired version of the code must have alredy -# been checked out prior to calling this script. +# The desired version of the code must have +# already been checked out prior to calling this +# script. # # Usage: MET_build # @@ -38,32 +39,27 @@ fi # Check for 0 or 1 arguments if [ ${NARGS} -eq 0 ]; then - VERSION="met-${CUR_REV}" + VERSION="${CUR_REV}" elif [ ${NARGS} -eq 1 ]; then - # Prepend met, if needed - if [[ ${1:0:3} != "met" ]]; then - VERSION="met-${1}" - else - VERSION="${1}" - fi + VERSION="${1}" else echo - echo "USAGE: MET_build " + echo "USAGE: MET_build " echo exit 1 fi +# Set the MET build version by stripping off leading "v" from "vX.Y" +export MET_BUILD_VERSION=`echo $VERSION | sed 's/v//g'` +echo "Building MET version '${MET_BUILD_VERSION}'" + # Copy the current met directory -echo "Building version '${VERSION}'..." -cp -r met ${VERSION} -cd ${VERSION} +cp -r met met-${MET_BUILD_VERSION} +cd met-${MET_BUILD_VERSION} # Cleanup rm -f `find ./ -name ".gitignore"` -# Set the MET build version for bootstrap by stripping off leading "met-" -export MET_BUILD_VERSION=`echo ${VERSION} | sed 's/met-//g'` - # Run the bootstrap program to prepare for running configure echo "Running 'bootstrap' to prepare for running configure" ./bootstrap > /dev/null @@ -105,8 +101,8 @@ make dist > /dev/null # Construct the desired name for the tar file. autoconf # creates the tar file using it's standard naming convention. -TAR_FILE="${VERSION}.${TODAY}.tar.gz" +TAR_FILE="met-${MET_BUILD_VERSION}.${TODAY}.tar.gz" -echo "Copying tar file to new name: '${TAR_FILE}'" +echo "Moving tar file to new name: '${TAR_FILE}'" mv met-* ../${TAR_FILE} diff --git a/scripts/build/met_checkout_and_build.sh b/scripts/build/met_checkout_and_build.sh index 80ea8313af..441884e8d8 100755 --- a/scripts/build/met_checkout_and_build.sh +++ b/scripts/build/met_checkout_and_build.sh @@ -84,7 +84,7 @@ run_command() { return ${STATUS} } -# Run svn info to update contents of version.txt +# Use the Git info to define version.txt get_git_info() { echo "CALLING: git config, git rev-parse, and git log" git config --get remote.origin.url | sed -r 's/^/Repository:\t\t/g' > met/data/version.txt