]> git.ozlabs.org Git - next-scripts/commitdiff
fetch_trees: allow to fetch a subset of trees
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Aug 2015 23:15:51 +0000 (09:15 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Aug 2015 23:15:51 +0000 (09:15 +1000)
fetch_trees

index 39f7924d0d28003d5cc3a642997a8756586fa2b3..b165bbf81c80b4b7a1a44bb0190adf2341c6d55b 100755 (executable)
@@ -1,5 +1,15 @@
 #!/bin/bash
 
+[ "$1" = "-s" ] && {
+       shift
+       start_from="$1"
+       [ -z "$start_from" ] && {
+               echo "-s requires a start tree" 1>&2
+               exit 1
+       }
+       shift
+}
+
 . "$(dirname $0)/common.sh" ""
 
 get_field()
@@ -83,6 +93,14 @@ trees="$@"
        trees=$(grep -v '^#' $CTRL_FILE | awk -F '\t' '{ print $3 }')
 
 for name in $trees; do
+       [ -n "$start_from" ] && {
+               if [ "$name" = "$start_from" ]; then
+                       start_from=""
+               else
+                       continue
+               fi
+       }
+
        type=$(get_field "$name" 2)
 
        echo $name: $type