]> saetta.ns0.it Git - msys2/commitdiff
Script controllo agg.: aggiunta opzione per non fare il check dei branch non presenti.
authorAndrea Zagli <azagli@libero.it>
Tue, 3 Sep 2019 14:37:53 +0000 (16:37 +0200)
committerAndrea Zagli <azagli@libero.it>
Tue, 3 Sep 2019 14:41:55 +0000 (16:41 +0200)
tools/autobuilder/debian_tobeupdated_all.sh

index 0b4c462381c134013b24653e1307aa6217af17b9..65382380cc20cbb1717f7f027252b93992b6fb00 100755 (executable)
@@ -1,11 +1,16 @@
 #!/bin/bash
 
 REMOTE=origin
+CHECKNEW=true
 
-while getopts "r:" opt; do
+while getopts "r:c" opt; do
     case $opt in
         r)
-          REMOTE=$OPTARG
+            REMOTE=$OPTARG
+            ;;
+        c)
+            CHECKNEW=false
+            ;;
     esac
 done
 
@@ -21,13 +26,20 @@ do
     CHECKED=`git branch | grep $BRANCH`
 
     if [ "$CHECKED" = "" ]; then
-       echo "Branch $BRANCH to be checked"
+       MSG="Branch $BRANCH to be checked"
+       if [ "$CHECKNEW" = false ]; then
+           MSG=$MSG" (but not checked as requested)"
+       fi
+       MSG=$MSG"."
+       echo $MSG
     fi
-    
-    git checkout $BRANCH &>> log.log
 
-    "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/debian_tobeupdated.sh &>> log.log
-    if [ $? -eq 1 ]; then
-       echo "Branch $BRANCH must be updated."
+    if [ "$CHECKED" != "" ] || ([ "$CHECKED" = "" ] && [ "$CHECKNEW" = true ]); then
+       git checkout $BRANCH &>> log.log
+
+       "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/debian_tobeupdated.sh &>> log.log
+       if [ $? -eq 1 ]; then
+           echo "Branch $BRANCH must be updated."
+       fi
     fi
 done