From 35fe22855d60f1e3e967a1442f387fe4d861a1bb Mon Sep 17 00:00:00 2001
From: Massimiliano Adamo <maxadamo@gmail.com>
Date: Wed, 22 Sep 2021 23:15:53 +0200
Subject: [PATCH] remove builtin variable

---
 acme-downloader.sh | 10 +++++-----
 build-bash.sh      |  6 +++---
 build-go.sh        |  6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/acme-downloader.sh b/acme-downloader.sh
index 234cae3..b6562e0 100755
--- a/acme-downloader.sh
+++ b/acme-downloader.sh
@@ -7,8 +7,8 @@
 # the certificate will be checked, if it is valid, if the key matches
 # and if it contains at least the cert-name
 #
-VERSION="VERSION_SET_BY_CI"
-BUILDTIME="BUILDTIME_SET_BY_CI"
+PROG_VERSION="VERSION_SET_BY_CI"
+BUILD_TIME="BUILDTIME_SET_BY_CI"
 REDIS_URL="https://redis.geant.org/GET"
 VAULT_URL="https://vault.geant.org/v1"
 TMP_CERT=$(mktemp)
@@ -44,9 +44,9 @@ check_version() {
     SCRIPT_URL="https://artifactory.software.geant.org/artifactory/acme-downloader/acme-downloader.sh"
     METADATA_URL="https://artifactory.software.geant.org/artifactory/api/storage/acme-downloader/acme-downloader.sh?properties=version"
     REMOTE_VERSION=$(curl -s $METADATA_URL | jq -j .properties.version[0])
-    if [[ $VERSION != $REMOTE_VERSION ]]; then
+    if [[ $PROG_VERSION != $REMOTE_VERSION ]]; then
         echo ""
-        echo "you are running version ${VERSION}"
+        echo "you are running version ${PROG_VERSION}"
         echo "version $REMOTE_VERSION is available"
         echo "in order to fetch and install the new version you can use the option: --update"
         echo ""
@@ -170,7 +170,7 @@ done
 
 # print version buildtime and say goodbye
 if [[ -n $PROG_VERSION ]]; then
-    echo "$(basename $0) version $VERSION built on ${BUILDTIME}"
+    echo "$(basename $0) version $PROG_VERSION built on ${BUILD_TIME}"
     clean_up 0
 fi
 
diff --git a/build-bash.sh b/build-bash.sh
index bf546e7..429704e 100755
--- a/build-bash.sh
+++ b/build-bash.sh
@@ -3,9 +3,9 @@
 # upload a copy of the script with version number and buildtime
 #
 if [ "$#" -gt 0 ]; then
-    VERSION=$1
+    PROG_VERSION=$1
 else
-    VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
+    PROG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
 fi
 AFACTORY_SCRIPT="acme-downloader-afactory.sh"
 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
@@ -17,5 +17,5 @@ fi
 rm -f $AFACTORY_SCRIPT
 cp acme-downloader.sh $AFACTORY_SCRIPT
 
-sed -i s/VERSION_SET_BY_CI/$VERSION/ $AFACTORY_SCRIPT
+sed -i s/VERSION_SET_BY_CI/$PROG_VERSION/ $AFACTORY_SCRIPT
 sed -i s/BUILDTIME_SET_BY_CI/$BUILDTIME/ $AFACTORY_SCRIPT
diff --git a/build-go.sh b/build-go.sh
index e806fce..54110ef 100755
--- a/build-go.sh
+++ b/build-go.sh
@@ -64,7 +64,7 @@ while true; do
         ;;
     --version)
         shift
-        VERSION="$1"
+        PROG_VERSION="$1"
         ;;
     --)
         shift
@@ -74,8 +74,8 @@ while true; do
     shift
 done
 
-if [[ -n $VERSION ]]; then
-    PROG_VERSION=$(echo $VERSION | tr -d v)
+if [[ -n $PROG_VERSION ]]; then
+    PROG_VERSION=$(echo $PROG_VERSION | tr -d v)
 else
     PROG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
 fi
-- 
GitLab