Browse code

Merge "Normalise RECLONE flag to True Or False."

Jenkins authored on 2013/09/29 21:30:48
Showing 1 changed files
... ...
@@ -551,6 +551,7 @@ function git_clone {
551 551
     GIT_REMOTE=$1
552 552
     GIT_DEST=$2
553 553
     GIT_REF=$3
554
+    RECLONE=$(trueorfalse False $RECLONE)
554 555
 
555 556
     if [[ "$OFFLINE" = "True" ]]; then
556 557
         echo "Running in offline mode, clones already exist"
... ...
@@ -576,7 +577,7 @@ function git_clone {
576 576
             cd $GIT_DEST
577 577
             # This checkout syntax works for both branches and tags
578 578
             git checkout $GIT_REF
579
-        elif [[ "$RECLONE" == "yes" ]]; then
579
+        elif [[ "$RECLONE" = "True" ]]; then
580 580
             # if it does exist then simulate what clone does if asked to RECLONE
581 581
             cd $GIT_DEST
582 582
             # set the url to pull from and fetch
... ...
@@ -1268,16 +1269,16 @@ function stop_service() {
1268 1268
 
1269 1269
 
1270 1270
 # Normalize config values to True or False
1271
-# Accepts as False: 0 no false False FALSE
1272
-# Accepts as True: 1 yes true True TRUE
1271
+# Accepts as False: 0 no No NO false False FALSE
1272
+# Accepts as True: 1 yes Yes YES true True TRUE
1273 1273
 # VAR=$(trueorfalse default-value test-value)
1274 1274
 function trueorfalse() {
1275 1275
     local default=$1
1276 1276
     local testval=$2
1277 1277
 
1278 1278
     [[ -z "$testval" ]] && { echo "$default"; return; }
1279
-    [[ "0 no false False FALSE" =~ "$testval" ]] && { echo "False"; return; }
1280
-    [[ "1 yes true True TRUE" =~ "$testval" ]] && { echo "True"; return; }
1279
+    [[ "0 no No NO false False FALSE" =~ "$testval" ]] && { echo "False"; return; }
1280
+    [[ "1 yes Yes YES true True TRUE" =~ "$testval" ]] && { echo "True"; return; }
1281 1281
     echo "$default"
1282 1282
 }
1283 1283