# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: update_branches,v 1.12 2005/05/17 00:58:41 marka Exp $
+# $Id: update_branches,v 1.13 2005/05/17 03:31:44 marka Exp $
#
# Track which branches are still open or not in the bind9 cvs repository.
%branches = ();
%whom = ();
%comments = ();
+$repository = "/proj/cvs/prod";
+$module = "bind9";
#
# Make sure we have a up to date copy. If the previous ran failed for
# any reason remove it (-C).
#
-!system("cvs", "-d", "/proj/cvs/prod", "update", "-C", "doc/private/branches") || die "cannot update doc/private/branches: $!";
+!system("cvs", "-d", $repository, "update", "-C", "doc/private/branches") || die "cannot update doc/private/branches: $!";
#
# load existing content
$c = "";
if (m://.*:) {
$c = $_;
- $c =~ s:.*?//(.*)$:$1:;
+ $c =~ s:.*?//\s*(.*)$:$1:;
s:(.*?)//.*:$1:;
} else {
+ #
+ # look for old style comment
+ #
if (m/\(.*\)/) {
$c = $_;
$c =~ s/.*\((.*)\).*$/$1/;
#
# Search repository for new branches.
#
-open(FILES, "find /proj/cvs/prod/bind9 -type f -name *,v -print |") || die "can't start find: $!";
+open(FILES, "find $repository/$module -type f -name *,v -print |") || die "can't start find: $!";
while (<FILES>) {
chomp;
# print "file: $_\n"; # debug
# $file = $_; # save for branch debug below.
- s:/proj/cvs/prod/bind9/::;
+ s:^$repository/::;
s:/Attic/([^/]*)$:/$1:;
- s:^Attic/([^/]*)$:$1:;
s:,v$::;
#
# use cvs so that the file is locked.
#
- open(FILE, "cvs log -h $_|") || die "can't start cvs log -h $_: $!";
+ #print "cvs -d $repository rlog -h $_\n";
+ open(FILE, "cvs -d $repository rlog -h $_|") || die "can't start cvs rlog -h $_: $!";
while (<FILE>) {
chomp;
next unless m/^symbols$/; # skip until we find the tags
# print "branch: $_ $file\n"; # debug
}
}
- last;
+ chomp while (<FILE>); # let cvs rlog exit normally.
}
close(FILE);
}
# Write out updated version.
#
open(BRANCHES, ">doc/private/newbranches") || die "can't open doc/private/branches: $!";
-print BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t(Comments)\n";
+print BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t// Comments\n";
print BRANCHES "----------------------------------------------------------\n\n";
+print BRANCHES "//\t\t\t\tnew\tnot yet clasified\n";
+print BRANCHES "//\t\t\t\topen\tdevelopement branch\n";
+print BRANCHES "//\t\t\t\tactive\tnot a development branch\n";
+print BRANCHES "//\t\t\t\treview\tready for review\n";
+print BRANCHES "//\t\t\t\tprivate\tprivate branch\n";
+print BRANCHES "//\t\t\t\tclosed\tfinished with\n";
+print BRANCHES "\n";
foreach $key (sort keys %branches) {
next if ($branches{$key} eq "closed");
print BRANCHES "$key";
}
print BRANCHES "$branches{$key}\t";
print BRANCHES "$whom{$key}";
- print BRANCHES "\t//$comments{$key}" if ($comments{$key} ne "");
+ print BRANCHES "\t// $comments{$key}" if ($comments{$key} ne "");
print BRANCHES "\n";
}
printf BRANCHES "\t";
}
print BRANCHES "$branches{$key}";
- print BRANCHES "\t\t//$comments{$key}" if ($comments{$key} ne "");
+ print BRANCHES "\t\t// $comments{$key}" if ($comments{$key} ne "");
print BRANCHES "\n";
}
close(BRANCHES);
#
if (system("cmp", "-s", "doc/private/newbranches", "doc/private/branches")) {
rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";
- !system("cvs", "-d", "/proj/cvs/prod", "commit", "-m", "auto update", "doc/private/branches") || die "cvs commit failed: $!";
+ !system("cvs", "-d", $repository, "commit", "-m", "auto update", "doc/private/branches") || die "cvs commit failed: $!";
} else {
unlink("doc/private/newbranches");
}