[rkward] macports: fixed replace_port.sh

m.eik michalke null at kde.org
Thu Apr 5 15:01:14 UTC 2018


Git commit 92c5fc7ed04fdfafd396ed2fb38402df0d4820cd by m.eik michalke.
Committed on 05/04/2018 at 15:00.
Pushed by meikm into branch 'master'.

fixed replace_port.sh

M  +12   -7    macports/replace_port.sh

https://commits.kde.org/rkward/92c5fc7ed04fdfafd396ed2fb38402df0d4820cd

diff --git a/macports/replace_port.sh b/macports/replace_port.sh
index 6b4b93de..2be492ff 100755
--- a/macports/replace_port.sh
+++ b/macports/replace_port.sh
@@ -9,6 +9,11 @@ MAKEPATH=/usr/bin/make
 # specify deactivation suffix
 DCTSFFX="_works"
 
+DEACT=false
+REACT=false
+IMAKE=false
+RMDCT=false
+    
 if [[ $1 == "" ]] ; then
  echo "Usage: replace_port.sh OPTION
           OPTIONS:
@@ -22,10 +27,10 @@ fi
 # get the options
 while getopts ":damx" OPT; do
   case $OPT in
-    d) DEACT=TRUE >&2 ;;
-    a) REACT=TRUE >&2 ;;
-    m) IMAKE=TRUE >&2 ;;
-    x) RMDCT=TRUE >&2 ;;
+    d) DEACT=true >&2 ;;
+    a) REACT=true >&2 ;;
+    m) IMAKE=true >&2 ;;
+    x) RMDCT=true >&2 ;;
     \?)
       echo "Invalid option: -$OPTARG" >&2
       exit 1
@@ -37,7 +42,7 @@ while getopts ":damx" OPT; do
   esac
 done
 
-if [[ $DEACT ]] ; then
+if $DEACT ; then
 	if [ -d "${MPTINST}${DCTSFFX}" ] ; then
 		echo "ouch: \"${MPTINST}${DCTSFFX}\" already exists, aborting!"
 		exit 1
@@ -55,8 +60,8 @@ if [[ $DEACT ]] ; then
 	fi
 fi
 
-if [[ $REACT ]] ; then
-	if [[ $IMAKE ]] && ! [ -f "${MAKEPATH}${DCTSFFX}" ] ; then
+if $REACT ; then
+	if $IMAKE && ! [ -f "${MAKEPATH}${DCTSFFX}" ] ; then
 		echo "ouch: \"${MAKEPATH}${DCTSFFX}\" doesn't exist, skipping!"
 	else
 		sudo mv "${MAKEPATH}${DCTSFFX}" "${MAKEPATH}"



More information about the rkward-tracker mailing list