From d620087d83fd5cde7b64296934be0ad905a254ab Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 27 Jun 2014 12:45:11 +0100 Subject: [PATCH] mg-list-all-branches: New script. 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 --- mg-list-all-branches | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 mg-list-all-branches diff --git a/mg-list-all-branches b/mg-list-all-branches new file mode 100755 index 0000000..c968a99 --- /dev/null +++ b/mg-list-all-branches @@ -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 () { + 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; -- 2.39.5