update_branches revision f91671c7dc877a52adc06d0a7d0ed1c7f6391e6e
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Permission to use, copy, modify, and distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews# PERFORMANCE OF THIS SOFTWARE.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# $Id: update_branches,v 1.3 2005/05/16 04:28:59 marka Exp $
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt!system("cvs", "-d", "/proj/cvs/prod", "update", "doc/private/branches") || die "cannot update doc/private/branches: $!";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# load existing content
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntopen(BRANCHES, "<doc/private/branches") || die "can't open util/branches: $!";
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews# Search repository for new branches.
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrewsopen(FILES, "find /proj/cvs/prod/bind9 -type f -name *,v -print |") || die "can't start find: $!";
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews next unless m/^symbols$/; # skip until we find the tags
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews next unless m/\.0\.\d$/; # skip if not a branch
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews# Write out updated version.
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrewsopen(BRANCHES, ">doc/private/newbranches") || die "can't open doc/private/branches: $!";
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntprint BRANCHES "-------------------------------------------------------\n\n";
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt print BRANCHES "\t$comments{$key}" if ($comments{$key} ne "");
5a75f61dd413720c16d229b24ebba6bd6ecdb738Evan Hunt print BRANCHES "\t\t$comments{$key}" if ($comments{$key} ne "");
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt# Update if changed.
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Huntif (system("cmp", "-s", "doc/private/newbranches", "doc/private/branches")) {
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews !system("cvs", "-d", "/proj/cvs/prod", "commit", "-m", "auto update", "doc/private/branches") || die "cvs commit failed: $!";