update_branches revision bdfd62f497fe0d5281c25b61271595a4c821a040
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Permission to use, copy, modify, and distribute this software for any
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# purpose with or without fee is hereby granted, provided that the above
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# copyright notice and this permission notice appear in all copies.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# PERFORMANCE OF THIS SOFTWARE.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# $Id: update_branches,v 1.11 2005/05/17 00:57:31 marka Exp $
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Track which branches are still open or not in the bind9 cvs repository.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# This is done so that work that is "in progress" (active) doesn't get
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# so easily forgotten about.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# This script updates doc/private/branches by adding new branches and moving
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# closed branches to the end of the file. New branches are found by walking
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# the cvs repository and extracting the new branches from the header fields
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# of the files there.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# doc/private/branches has one line per branch in the following field order:
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# name, status, to whom the branch belongs and comments. Comments are
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# in '(',')'. The first three field are single words.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Make sure we have a up to date copy. If the previous ran failed for
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# any reason remove it (-C).
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews!system("cvs", "-d", "/proj/cvs/prod", "update", "-C", "doc/private/branches") || die "cannot update doc/private/branches: $!";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# load existing content
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrewsopen(BRANCHES, "<doc/private/branches") || die "can't open util/branches: $!";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Search repository for new branches.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrewsopen(FILES, "find /proj/cvs/prod/bind9 -type f -name *,v -print |") || die "can't start find: $!";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews open(FILE, "cvs log -h $_|") || die "can't start cvs log -h $_: $!";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews next unless m/^symbols$/; # skip until we find the tags
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews next unless m/\.0\.\d$/; # skip if not a branch
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Write out updated version.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrewsopen(BRANCHES, ">doc/private/newbranches") || die "can't open doc/private/branches: $!";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrewsprint BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t(Comments)\n";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrewsprint BRANCHES "----------------------------------------------------------\n\n";
$tabs = 1;
$tabs++;
rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";