From e0f725a23e26c3329348bf2eeb45c65ed7720540 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Thu, 21 Sep 2023 12:09:01 +0300 Subject: [PATCH] fix build script Signed-off-by: Michael Sverdlov --- build/deb_rpm/v2-jf/build-scripts/rpm-sign.sh | 2 +- build/deb_rpm/v2/build-scripts/rpm-sign.sh | 2 +- build/installcli/jf.sh | 7 +++---- build/installcli/jfrog.sh | 7 +++---- build/setupcli/jf.sh | 7 +++---- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/build/deb_rpm/v2-jf/build-scripts/rpm-sign.sh b/build/deb_rpm/v2-jf/build-scripts/rpm-sign.sh index 5a94ce9fe..144756a68 100755 --- a/build/deb_rpm/v2-jf/build-scripts/rpm-sign.sh +++ b/build/deb_rpm/v2-jf/build-scripts/rpm-sign.sh @@ -23,7 +23,7 @@ rpmInitSigning(){ log "Initializing rpm sign..." - gpg --allow-secret-key-import --import ${gpgKeyFile} && \ + gpg --allow-secret-key-import --import "${gpgKeyFile}" && \ gpg --export -a "${keyID}" > /tmp/tmpFile && \ rpm --import /tmp/tmpFile && \ rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n' | grep "${keyID}" || \ diff --git a/build/deb_rpm/v2/build-scripts/rpm-sign.sh b/build/deb_rpm/v2/build-scripts/rpm-sign.sh index 5a94ce9fe..144756a68 100755 --- a/build/deb_rpm/v2/build-scripts/rpm-sign.sh +++ b/build/deb_rpm/v2/build-scripts/rpm-sign.sh @@ -23,7 +23,7 @@ rpmInitSigning(){ log "Initializing rpm sign..." - gpg --allow-secret-key-import --import ${gpgKeyFile} && \ + gpg --allow-secret-key-import --import "${gpgKeyFile}" && \ gpg --export -a "${keyID}" > /tmp/tmpFile && \ rpm --import /tmp/tmpFile && \ rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n' | grep "${keyID}" || \ diff --git a/build/installcli/jf.sh b/build/installcli/jf.sh index 041af915f..e0220557d 100755 --- a/build/installcli/jf.sh +++ b/build/installcli/jf.sh @@ -3,8 +3,6 @@ CLI_OS="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" -# Order is by destination priority. -DESTINATION_PATHS="/usr/local/bin /usr/bin /opt/bin" if [ $# -eq 1 ] then @@ -65,11 +63,12 @@ curl -XGET "$URL" -L -k -g > $FILE_NAME chmod u+x $FILE_NAME # Move executable to a destination in path. -set -- $DESTINATION_PATHS +# Order is by destination priority. +set -- "/usr/local/bin" "/usr/bin" "/opt/bin" while [ -n "$1" ]; do # Check if destination is in path. if echo "$PATH"|grep "$1" -> /dev/null ; then - mv $FILE_NAME $1 + mv $FILE_NAME "$1" if [ "$?" -eq "0" ] then echo "" diff --git a/build/installcli/jfrog.sh b/build/installcli/jfrog.sh index 9765a1b9e..87d92f482 100755 --- a/build/installcli/jfrog.sh +++ b/build/installcli/jfrog.sh @@ -3,8 +3,6 @@ CLI_OS="na" CLI_MAJOR_VER="v2" VERSION="[RELEASE]" -# Order is by destination priority. -DESTINATION_PATHS="/usr/local/bin /usr/bin /opt/bin" if [ $# -eq 1 ] then @@ -65,11 +63,12 @@ curl -XGET "$URL" -L -k -g > $FILE_NAME chmod u+x $FILE_NAME # Move executable to a destination in path. -set -- $DESTINATION_PATHS +# Order is by destination priority. +set -- "/usr/local/bin" "/usr/bin" "/opt/bin" while [ -n "$1" ]; do # Check if destination is in path. if echo "$PATH"|grep "$1" -> /dev/null ; then - mv $FILE_NAME $1 + mv $FILE_NAME "$1" if [ "$?" -eq "0" ] then echo "" diff --git a/build/setupcli/jf.sh b/build/setupcli/jf.sh index 8e9b1265b..f6a7d5a45 100755 --- a/build/setupcli/jf.sh +++ b/build/setupcli/jf.sh @@ -3,8 +3,6 @@ CLI_OS="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" -# Order is by destination priority. -DESTINATION_PATHS="/usr/local/bin /usr/bin /opt/bin" SETUP_COMMAND="jf setup" GREEN_COLOR='\033[0;32m' REMOVE_COLOR='\033[0m' @@ -69,11 +67,12 @@ curl -XGET "$URL" -L -k -g > $FILE_NAME chmod u+x $FILE_NAME # Move executable to a destination in path. -set -- $DESTINATION_PATHS +# Order is by destination priority. +set -- "/usr/local/bin" "/usr/bin" "/opt/bin" while [ -n "$1" ]; do # Check if destination is in path. if echo "$PATH"|grep "$1" -> /dev/null ; then - mv $FILE_NAME $1 + mv $FILE_NAME "$1" if [ "$?" -eq "0" ] then echo ""