update_branches revision bdfd62f497fe0d5281c25b61271595a4c821a040
#
# Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: update_branches,v 1.11 2005/05/17 00:57:31 marka Exp $
#
# Track which branches are still open or not in the bind9 cvs repository.
# This is done so that work that is "in progress" (active) doesn't get
# so easily forgotten about.
#
# closed branches to the end of the file. New branches are found by walking
# the cvs repository and extracting the new branches from the header fields
# of the files there.
#
# name, status, to whom the branch belongs and comments. Comments are
# in '(',')'. The first three field are single words.
#
%branches = ();
%whom = ();
%comments = ();
#
# 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: $!";
#
# load existing content
#
while (<BRANCHES>) {
next if (/^-/);
$c = "";
if (m://.*:) {
$c = $_;
$c =~ s:.*?//(.*)$:$1:;
s:(.*?)//.*:$1:;
} else {
if (m/\(.*\)/) {
$c = $_;
$c =~ s/.*\((.*)\).*$/$1/;
s/\(.*\)//;
}
}
s/\s$//;
next if (/^\s*$/);
}
#
# Search repository for new branches.
#
while (<FILES>) {
# print "file: $_\n"; # debug
# $file = $_; # save for branch debug below.
s:,v$::;
#
# use cvs so that the file is locked.
#
next unless m/\.0\.\d$/; # skip if not a branch
s/\s(.*):.*/$1/; # extract label
# print "branch: $_ $file\n"; # debug
}
}
last;
}
}
#
# Write out updated version.
#
print BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t(Comments)\n";
print BRANCHES "----------------------------------------------------------\n\n";
$tabs = 1;
} else {
$tabs++;
}
}
}
}
print BRANCHES "\n\n";
$tabs = 1;
} else {
$tabs++;
}
}
}
}
#
# Update if changed.
#
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: $!";
} else {
}