]> xenbits.xensource.com Git - osstest.git/commitdiff
mg-list-all-branches: New script.
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 27 Jun 2014 11:45:11 +0000 (12:45 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 30 Jun 2014 10:16:35 +0000 (11:16 +0100)
The approach here is a little unpleasant but it has the virtue of
getting the ones out of crontab too, and of not depending on the
production database (which will in any case contain obsolete flights).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
mg-list-all-branches [new file with mode: 0755]

diff --git a/mg-list-all-branches b/mg-list-all-branches
new file mode 100755 (executable)
index 0000000..c968a99
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+# prints on stdout a list of all the "branches"
+# mentioned in cr-daily-branch or crontab
+
+use strict;
+
+our %branches;
+
+foreach my $f (qw(cr-for-branches crontab)) {
+    open C, $f or die $!;
+    while (<C>) {
+        next unless m/(?:EXTRA_)?BRANCHES[:+]?='?([-.0-9a-z ]+)/;
+        $branches{$_}=1 foreach split /\s+/, $1;
+    }
+    close C or die $!;
+}
+
+print $_,"\n" or die $! foreach sort keys %branches;