update_branches revision 11b07ea523314b123b4e503ce3813443a018c8d3
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Permission to use, copy, modify, and distribute this software for any
2deb319e6b3de239f45c16a3e9e836d44f1f7108rbb# purpose with or without fee is hereby granted, provided that the above
2deb319e6b3de239f45c16a3e9e836d44f1f7108rbb# copyright notice and this permission notice appear in all copies.
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanoj# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard# PERFORMANCE OF THIS SOFTWARE.
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# $Id: update_branches,v 1.20 2007/01/30 06:29:21 marka Exp $
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# Track which branches are still open or not in the bind9 cvs repository.
632b0b53511f3bb9c32aa2869fbc73ee35081b38rbb# This is done so that work that is "in progress" (active) doesn't get
632b0b53511f3bb9c32aa2869fbc73ee35081b38rbb# so easily forgotten about.
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# This script updates doc/private/branches by adding new branches and moving
f6a6245816cd866361da8c576b1f47c7a54b6610fanf# closed branches to the end of the file. New branches are found by walking
f755f06050191550f77c825eff6b0e48a35b3e91dgaudet# the cvs repository and extracting the new branches from the header fields
f755f06050191550f77c825eff6b0e48a35b3e91dgaudet# of the files there.
211bf1d44f4653bf753a15740cd5ebbf330b6e93manoj# doc/private/branches has one line per branch in the following field order:
211bf1d44f4653bf753a15740cd5ebbf330b6e93manoj# name, status, to whom the branch belongs and comments. Comments are
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# in '(',')'. The first three field are single words.
369edcdd0a9c5516c61e736ec2a6fc8fb0d92fe2manoj# Note: this is intended to be run on the machine hosting the CVS repository.
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard%history = ();
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard# Make sure we have a up to date copy. If the previous ran failed for
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard# any reason remove it (-C).
75960f20f88dad6bc67892c711c429946063d133stoddard!system("cvs", "-d", $repository, "update", "-C", "doc/private/branches") || die "cannot update doc/private/branches: $!";
75960f20f88dad6bc67892c711c429946063d133stoddard# load existing content
75960f20f88dad6bc67892c711c429946063d133stoddardopen(BRANCHES, "<doc/private/branches") || die "can't open util/branches: $!";
2aae6faee508221efbeaba5547ca79b7a20ef047stoddard s/\(.*\)//;
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanoj# T 1999-03-15 21:15 +0000 vixie bind [ietf44:A]
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanojopen(HISTORY, "cvs history -T -a 2> /dev/null |") || die("can't get history");
1e585ba09ea32272e63c4c39c35491e975d21d98stoddard s/:[^ \t]+$//;
9c09943bad734ebd5c7cc10bd6d63b75c4c6e056stoddard ($tag, $date, $time, $tz, $who, $mod, $branch) = split;
f03d292915be9977eaf74e9be7b0404aec226f84manoj# Search repository for new branches.
aa1faea36e4ae357bc603a2337b6adc54f5daec1manoj# New branches have the following format "name:<revision>.0.#"
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# where # is the number of potential branches from this the revision.
302dc1f7b3feee23a91ad8f3cf3cb2edd95a557bmanojopen(FILES, "find $repository/$module -type f -name *,v -print |") || die "can't start find: $!";
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgstein open(FILE, "cvs -d $repository rlog -h $_|") || die "can't start cvs rlog -h $_: $!";
c03566fa0156d3a1500a42e4fe539e3e0fc8a11dgstein next unless m/^symbolic names:$/; # skip until we find the tags
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# Write out updated version.
2a6c49cfaef5979a5a06098f3ce987cd76769409manojopen(BRANCHES, ">doc/private/newbranches") || die "can't open doc/private/branches: $!";
2a6c49cfaef5979a5a06098f3ce987cd76769409manojprint BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t// Comments\n";
2a6c49cfaef5979a5a06098f3ce987cd76769409manojprint BRANCHES "-----------------------------------------------------------\n\n";
f6a6245816cd866361da8c576b1f47c7a54b6610fanfprint BRANCHES "\t\t\t\tactive\t\tnot a development branch\n";
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj print BRANCHES "\t// $comments{$key}" if ($comments{$key} ne "");
$tabs = 1;
$tabs++;
rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";