update_branches revision 73cac2175470e9068829589476dda8bd6d88036f
c7ef13f6c9ef4436bc804b150e0a93307b11fa27Tinderbox User# Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Permission to use, copy, modify, and distribute this software for any
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# purpose with or without fee is hereby granted, provided that the above
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater# copyright notice and this permission notice appear in all copies.
fe84edc17e0d582cf7b4270f8df9d4742a107b1cAutomatic Updater# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bed0874e1a09e810575328c4bfc346a47514b69fMark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# PERFORMANCE OF THIS SOFTWARE.
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater# $Id: update_branches,v 1.16 2005/05/17 03:54:26 marka Exp $
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater# Track which branches are still open or not in the bind9 cvs repository.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# This is done so that work that is "in progress" (active) doesn't get
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# so easily forgotten about.
89623368b8f662d458d9964b923050f33c5f75b0Tinderbox User# This script updates doc/private/branches by adding new branches and moving
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# closed branches to the end of the file. New branches are found by walking
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# the cvs repository and extracting the new branches from the header fields
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# of the files there.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# doc/private/branches has one line per branch in the following field order:
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# name, status, to whom the branch belongs and comments. Comments are
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# in '(',')'. The first three field are single words.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Note: this is intended to be run on the machine hosting the CVS repository.
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# Make sure we have a up to date copy. If the previous ran failed for
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# any reason remove it (-C).
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt!system("cvs", "-d", $repository, "update", "-C", "doc/private/branches") || die "cannot update doc/private/branches: $!";
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# load existing content
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updateropen(BRANCHES, "<doc/private/branches") || die "can't open util/branches: $!";
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Search repository for new branches.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# New branches have the following format "name:<revision>.0.#"
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# where # is the number of potential branches from this the revision.
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrewsopen(FILES, "find $repository/$module -type f -name *,v -print |") || die "can't start find: $!";
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews open(FILE, "cvs -d $repository rlog -h $_|") || die "can't start cvs rlog -h $_: $!";
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews next unless m/^symbols$/; # skip until we find the tags
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater last if (m/^locks;/); # we are past the tags
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews next unless m/\.0\.\d$/; # skip if not a branch
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews chomp while (<FILE>); # let cvs rlog exit normally.
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater# Write out updated version.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updateropen(BRANCHES, ">doc/private/newbranches") || die "can't open doc/private/branches: $!";
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonprint BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t// Comments\n";
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterprint BRANCHES "-----------------------------------------------------------\n\n";
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsprint BRANCHES "\t\t\t\tnew\t\tnot yet classified\n";
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonprint BRANCHES "\t\t\t\topen\t\tdevelopement branch\n";
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updaterprint BRANCHES "\t\t\t\tactive\t\tnot a development branch\n";
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updaterprint BRANCHES "\t\t\t\treview\t\tready for review\n";
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updaterprint BRANCHES "\t\t\t\tprivate\t\tprivate branch\n";
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updaterprint BRANCHES "\t\t\t\tclosed\t\tfinished with\n";
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater print BRANCHES "\t// $comments{$key}" if ($comments{$key} ne "");
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater print BRANCHES "\t\t// $comments{$key}" if ($comments{$key} ne "");
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater# Update if changed.
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrewsif (system("cmp", "-s", "doc/private/newbranches", "doc/private/branches")) {
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater !system("cvs", "-d", $repository, "commit", "-m", "auto update", "doc/private/branches") || die "cvs commit failed: $!";