update_branches revision 64cde9d94a2f6c7050f00d9651df6b05e63d09f2
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.
64cde9d94a2f6c7050f00d9651df6b05e63d09f2Mark Andrews# $Id: update_branches,v 1.6 2005/05/16 07:02:22 marka Exp $
648ba62b1f156cbca14d54d06c535385f1193d13Mark Andrews!system("cvs", "-d", "/proj/cvs/prod", "update", "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 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: $!";
c6313caa6cd9d011ac075048d2b62fd3410162dfMark Andrewsprint BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t(Comments)\n";
c6313caa6cd9d011ac075048d2b62fd3410162dfMark Andrewsprint BRANCHES "----------------------------------------------------------\n\n";
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews print BRANCHES "\t$comments{$key}" if ($comments{$key} ne "");
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews print BRANCHES "\t\t$comments{$key}" if ($comments{$key} ne "");
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews# Update if changed.
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrewsif (system("cmp", "-s", "doc/private/newbranches", "doc/private/branches")) {
d9b4174233b951f25cd53a2787b9f14314258c2fMark Andrews rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";
648ba62b1f156cbca14d54d06c535385f1193d13Mark Andrews !system("cvs", "-d", "/proj/cvs/prod", "commit", "-m", "auto update", "doc/private/branches") || die "cvs commit failed: $!";