setup-all-dchroots: Support rebuilding just one arch/suite
authorPeter Palfrader <peter@palfrader.org>
Thu, 16 Aug 2018 08:08:52 +0000 (10:08 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 16 Aug 2018 08:08:52 +0000 (10:08 +0200)
modules/schroot/files/setup-all-dchroots

index 7ff84b4..ec98163 100755 (executable)
@@ -70,8 +70,10 @@ cat << EOF
 usage: $0 [<options>] [buildd]
 
 OPTIONS:
+    -a <ARCH>  limit to ARCH
     -c         write config only
     -h         this help
+    -s <SUITE> limit to SUITE
 EOF
 }
 
@@ -83,9 +85,14 @@ EOF
 # parse options
 ##########
 EXTRAARGS=""
-while getopts "cu" OPTION
+limitarch=""
+limitsuite=""
+while getopts "cha:s:" OPTION
 do
     case $OPTION in
+        a)
+            limitarch="$OPTARG"
+            ;;
         c)
             EXTRAARGS="$EXTRAARGS -c"
             ;;
@@ -93,6 +100,9 @@ do
             usage
             exit 0
             ;;
+        s)
+            limitsuite="$OPTARG"
+            ;;
         *)
             usage >&2
             exit 1
@@ -162,7 +172,9 @@ esac
 err=0
 
 for a in $archs; do
+    [ "$limitarch" != "" ] && [ "$limitarch" != "$a" ] && continue
     for s in `get_suites "$a"`; do
+        [ "$limitsuite" != "" ] && [ "$limitsuite" != "$s" ] && continue
         if ! do_one "$a" "$s"; then
             err=1
             echo >&2