Remove unused or outdated utils, developer and design documentation

The util/, doc/design/, and doc/dev/ directories included couple of
tools or documents there were completely outdated because they either
refered the the VCS we no longer use (cvs) or described processes that
have been redesigned and they are documented elsewhere.
This commit is contained in:
Ondřej Surý
2021-06-02 12:48:18 +02:00
parent da8b5d7947
commit df4d072c72
14 changed files with 0 additions and 1746 deletions

View File

@@ -1,16 +0,0 @@
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
See COPYRIGHT in the source root or https://isc.org/copyright.html for terms.
Here are some hints on how to use autoconf correctly when doing
BIND 9 development.
Never edit the configure script directly. Edit configure.in, commit
the changes, run "autoconf", and commit the new configure. Doing two
separate commits ensures that the version numbers embedded in the
configure script are correct.
Don't edit config.h.in directly. Instead, run "autoheader". If it
complains about missing definitions, add them to acconfig.h, rerun
autoheader, commit acconfig.h if edited, and commit the generated
config.h.in.

View File

@@ -1,97 +0,0 @@
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
See COPYRIGHT in the source root or https://isc.org/copyright.html for terms.
Notes on CVS Usage
Accessing the repository
The recommended way of accessing the BIND 9 CVS repository is by ssh
to rc.isc.org, using the following environment settings:
CVSROOT=:ext:rc.isc.org:/proj/cvs/isc
CVS_RSH=ssh
Creating a release branch
Here's how the 9.0 release branch was created:
cvs rtag v9_0_base bind9
cvs rtag -b -r v9_0_base v9_0 bind9
Renaming files by repository copy
When you need to rename or move a file that is under CVS control, use
the "repository copy" method as described in the following text
borrowed from an ancient CVS FAQ:
2C.4 How do I rename a file?
CVS does not offer a way to rename a file in a way that CVS can
track later. See Section 4B for more information.
Here is the best way to get the effect of renaming, while
preserving the change log:
1. Copy the RCS (",v") file directly in the Repository.
cp $CVSROOT/<odir>/<ofile>,v $CVSROOT/<ndir>/<nfile>,v
2. Remove the old file using CVS.
By duplicating the file, you will preserve the change
history and the ability to retrieve earlier revisions of the
old file via the "-r <tag/rev>" or "-D <date>" options to
"checkout" and "update".
cd <working-dir>/<odir>
rm <ofile>
cvs remove <ofile>
cvs commit <ofile>
3. Retrieve <newfile> and remove all the Tags from it.
By stripping off all the old Tags, the "checkout -r" and
"update -r" commands won't retrieve revisions Tagged before
the renaming.
cd <working-dir>/<ndir>
cvs update <nfile>
cvs log <nfile> # Save the list of Tags
cvs tag -d <tag1> <nfile>
cvs tag -d <tag2> <nfile>
. . .
This technique can be used to rename files within one directory or
across different directories. You can apply this idea to
directories too, as long as you apply the above to each file and
don't delete the old directory.
Of course, you have to change the build system (e.g. Makefile) in
your <working-dir> to know about the name change.
Pulling up a newly added file to a release branch:
In a mainline working tree, do something like this:
cvs tag v9_0_base file
cvs tag -b -r v9_0_base v9_0 file
Importing contrib source from vendor release
As an example, here's how queryperf was imported:
cd /tmp
cvs -d shell.nominum.com:/proj/cvs/nominum export -rHEAD queryperf
cd queryperf
cvs -d rc.isc.org:/proj/cvs/isc import bind9/contrib/queryperf \
NOMINUM NOMINUM_20010710

View File

@@ -1,238 +0,0 @@
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
See COPYRIGHT in the source root or https://isc.org/copyright.html for terms.
Preparing a bind9 release
Here's a rough outline of the steps to follow in preparing a new bind9
release.
- Update the README file
- Send the new README file to webteam@nominum.com at least 48
hours prior to the planned release and ask them to prepare
the web pages for the new version. If there have been only
minor changes, send context diffs relative to the previous
release instead.
- Do a "cvs update" to check that all changes have been committed.
- Verify that the file "version" contains the correct version
number (it should have been incremented after the
previous release)
- If building from a release branch, check that any important
bug fixes made on the mainline since the last release have
been pulled up. You can do this by comparing the CHANGES
files using the util/check-pullups.pl script. For example,
running the script from a mainline tree:
perl util/check-pullups.pl CHANGES ../9.2/CHANGES ../9.2/EXCLUDED
This will list all bug fixes on the mainline that are not
on the 9.2 release branch.
- Before creating a new release branch, update the lib/*/api files
as needed. See the libtool info file for information about what
the various numbers mean.
cvs rdiff -r <last_release> -r <branch/HEAD> bind9/lib > diff
e.g.
cvs rdiff -r v9_4_0rc2 -r v9_4 bind9/lib > diff
- Check that https://internal.isc.org/bind-build/
shows a clean build and test status for all supported
systems and that the tests are actually being run on the
version being released (the version can be found in the
page behind the "Source tar build" link).
- Check that running "make all_tests" in bin/tests does not
produce compile errors.
- Regenerate the documentation by running "make man" (mainline/9.2)
or by running genhtml.sh in doc/arm (9.1 release branch)
and commit it. Note that not all machines have the
necessary XML tools, but at least trebuchet, cuba,
and Scanner's machine do. Commit any files that were
regenerated.
Most of this has now been automated, only doc/arm/ARM.pdf will
not be committed:
ssh tbox@docs.lab.isc.org
run this command from crontab.
1 1 * * * /usr/bin/lockf -s -t 0 /udir/tbox/bind9-documents/regenerate.lock /udir/tbox/bind9-documents/regenerate
Check to see if the ARM has changed since the last release
and if it has commit doc/arm/ARM.pdf.
e.g.
cvs rdiff -r v9_6_1 -r v9_6 bind9/doc/arm
cd bind9-documents/bind9.v9_6
cvs commit doc/arm/ARM.pdf
- Verify that the documents in doc/misc are up-to-date.
- Update the copyrights.
ssh tbox@cvs.isc.org
run these two command from the crontab
#
# Merge and Update copyrights
#
30 23 * * * /usr/bin/lockf -s -t 3600 /udir/tbox/tarballs/build-tarballs.lock /bin/sh /udir/tbox/tarballs/mergecopyrights
45 23 * * * /usr/bin/lockf -s -t 3600 /udir/tbox/updatecopyrights/updatecopyrights.lock /bin/sh /udir/tbox/updatecopyrights/updatecopyrights
When tbox@cvs.isc.org is not available:
Go to the root of the source tree.
The scripts need to be run from there; they reference the util
subdirectory internally.
$ make distclean
... [I prefer to check out a fresh source tree --gson]
$ perl util/merge_copyrights
$ diff util/copyrights util/newcopyrights
... examine output, particularly any files with the "?" type, and
... then edit util/newcopyrights if necessary
$ mv util/newcopyrights util/copyrights
$ cvs ci -m'merge_copyrights' util/copyrights
$ perl util/update_copyrights < util/copyrights
$ cvs diff
... examine output, edit as necessary. mail me about anything that
... the script should have been able to do itself. :-)
$ cvs ci -m'update_copyrights'
- Announce a CVS freeze if doing an alpha or beta release from
the mainline, or stop doing pullups if building from a release branch.
- Run util/altbuild.sh. This is to make sure that
builds using libtool, separate source/object directories, and other
obscure build options work. This script may need some hacking if run
on anything other than NetBSD. Save the output (it's big) and look
for error and warning messages.
cd $top_of_mainline_tree
sh util/altbuild.sh v9_0
or
cd $top_of_9_1_tree
sh util/altbuild.sh v9_1
Alteratively, you can do this after building the kit, by giving
the kit .tar.gz file as an argument to altbuild.sh instead of
the CVS tag.
- If you can (= your system is similar enough to the one Tale is using),
check the header files for cruft by running the command
[ This step is quite imperfect and should probably be skipped
for now -- Tale ]
find lib -name '*.h' -print | xargs perl util/check-includes.pl
- Add a marker line like " --- 9.0.0rc10 released ---"
to the CHANGES file.
- Tag the CVS source tree with the final tag, as in
"cvs rtag v9_0_0rc1 bind9" (mainline) or
"cvs rtag -r v9_2 v9_2_0rc10 bind9" (release branch).
- Build the release kit. This procedure differs
between the 9.0 release branch and later versions.
On the 9.0 release branch,
cd <temporary directory>
cvs export -r v9_0_0rc10 bind9
cd bind9
sh configure
make kit
On the 9.[1-2] release branch or mainline, use the
"util/kit.sh" script.
- Build bind9 from the kit on ns-ext (phred)
and ns-int (rc), install it, and let it run for
a day keeping an eye on it for any problems.
ssh phred.isc.org
ver=9.2.0
scp rc.isc.org:bind-$ver.tar.gz .
gunzip <bind-$ver.tar.gz | tar xfv -
cd bind-$ver
sh configure
make
su
make install
ps -elf | grep named
# kill both the keep-running script and named itself
/var/named/keep-running ns-ext &
ssh rc
ver=9.2.0
gunzip <bind-$ver.tar.gz | tar xfv -
cd bind-$ver
sh configure
make
su
make install
mv /usr/local/sbin/named /usr/local/sbin/named9
ps -elf | grep named
# kill both keep-running scripts and both named9:s
/var/named/keep-running9 rc-res1 &
/var/named/keep-running9 ns-int &
- If you can, try resolving some IPv6 addresses and
doing queries over IPv6.
- If problems are found at this stage, fix them, move the
release tag up using "rtag -F", and respin the kit.
- Sign the distribution files with the ISC signing PGP key
and fix the permissions on the signature file:
ver=9.2.0
pgp -sba bind-$ver.tar.gz -u 0x51BAB2ED
chmod 644 bind-$ver.tar.gz.asc
- Verify the PGP signature:
pgp bind-$ver.tar.gz.asc bind-$ver.tar.gz
(Look for the words "Good signature" in the output.)
- If there is a companion binary kit for NT, sign it and verify the
signature:
scp rc.isc.org:/udir/mayer/BIND$ver.zip .
pgp -sba BIND$ver.zip -u 0x51BAB2ED
chmod 644 BIND$ver.zip.asc
pgp BIND$ver.zip.asc BIND$ver.zip
- Prepare a release announcement based on the previous one.
- Copy the distribution and PGP signature files to the FTP site:
ssh -n isrv4.pa.vix.com "mkdir /udir/ftp/isc/bind9/$ver"
scp bind-$ver.tar.gz bind-$ver.tar.gz.asc \
isrv4.pa.vix.com:/udir/ftp/isc/bind9/$ver
- If there is a companion binary kit for NT, copy it, too:
ssh -n isrv4.pa.vix.com "mkdir /udir/ftp/isc/bind/contrib/ntbind-$ver"
scp BIND$ver.zip BIND$ver.zip.asc \
isrv4.pa.vix.com:/udir/ftp/isc/bind/contrib/ntbind-$ver
- Download using FTP (or a web browser) using the URLs in the release
announcement and verify the PGP signature again
- Ask webteam@nominum.com to publish the updated web pages
- When the web pages are up, announce the release on
bind-announce@isc.org
- Increment the version in the file "version", "configure.in" and
"doc/arm/Bv9ARM-book.xml".
- Resume doing pullups

View File

@@ -1,124 +0,0 @@
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
See COPYRIGHT in the source root or https://isc.org/copyright.html for terms.
We do hourly test builds of the bind9 tree. This is an attempt to
document how they work.
* How things work
The scripts driving the build system are in ~wpk/b9t. They are now
under CVS control; the repository is in rc:/proj/cvs/isc/b9t (note
that this is a separate repository from the bind9 one). The builds
are driven by cron jobs separately installed on each build system,
running as user wpk.
The sources are checked out, and the web reports are generated,
on bb, as driven by the following cron jobs:
# Check out the current bind 9 version and make the source tarball.
# Argument to maketar.sh should be v9_0 for 9.0 release branch,
# HEAD for mainline.
35 2-22 * * * PLATFORM=BSD-3.1 && . $HOME/b9t/hosts/$PLATFORM/env && \
nice sh $HOME/b9t/bin/maketar.sh HEAD \
>/proj/build-reports/bind9/tarsrc.txt 2>&1
#
# run the bind 9 build status report generator
#
30 3-22 * * * perl $HOME/b9t/bin/b9status.pl \
> /proj/build-reports/bind9/bind9.html 2> /dev/null
Each host has a separate crontab entry for building the server and
running tests. Here are examples from bb and sol:
#
# build the BSD-3.1 version of bind 9
#
0 3-22 * * * $HOME/b9t/bin/b9t.cron BSD-3.1
#
# bind 9 build for Solaris 5.6
#
0 3-22 * * * $HOME/b9t/bin/b9t.cron SunOS-5.6
Do not confuse the shell script ~wpk/b9t/bin/b9t.cron with the crontab
template (?) ~wpk/b9t/b9t.cron. Although they have the same name,
they are not related.
The shell script b9t.cron then calls make, using the makefile b9t.mk
in the same location. This makefile moves the old status files out of
the way and runs through the tests.
The current test schedule is as follows:
:35 CVS tree extracted, tarball built and distributed
:00 Most tests begin
:45 Status report generator runs (was :30)
bb: Build starts at top of hour, 0300 to 2200
durango: Build starts at top of hour, 0300 to 2200
trantor: Build starts at top of hour, 0300 to 2100, odd-numbered hours
only
hp: Build starts at top of hour, 0300 to 2200
irix: Build starts at top of hour, 0300 to 2200
netbsd: Build starts at top of hour, 0300 to 2200 (was :45)
aa: Build starts at top of hour, 0300 to 2200
rc: Build starts at top of hour, 0300 to 2200
mirepoix: Build starts at top of hour, 0300 to 2200
sol: Build starts at top of hour, 0300 to 2200
truffle: Build starts at top of hour, 0300 to 2200
anthrax: Build starts at top of hour, 0300 to 2200
The actual builds take place in a directory whose location differs
among systems. On most of them, it's on a local disk, under /build.
On some, it's on NFS; in this case the location is defined in
~wpk/b9t/hosts/$PLATFORM/env.
The output from the make process is in
~wpk/b9t/hosts/$PLATFORM/b9t-status, and the output from
The output from the later stages of the process is under
/proj/build-reports/bind9/hosts/$PLATFORM. To make the files
harder to find (?), they have names starting with a period:
.populate
.config
.build
.test
* Common problems
Sometime named processes fail to die when the tests are done,
interfering with the next test. Just kill them.
On hp.rc.vix.com, the tests often fail because of NFS I/O errors.
When this happens, the machine needs to be rebooted. It will not
come up again without manually entering commands on the console.
On bb, the tests sometimes fail because .nfs* files stuck in the build
tree keep it from being completely deleted when the next test runs.
The .nfs* files cannot be deleted, but they can be moved, so one way
of fixing this is to move them to ~wpk.
On aix, the tests routinely fail with an assertion failure related
to omapi socket handling - see RT #507.
* Failure locking
When a test fails, further testing on that host is disabled in order
to preserve evidence. Also, tests don't start if they are already
running. Both of these rules are enforce through "lockout files"
craeted in /proj/build-reports/bind9/hosts/*/.
To remove the lockout and allow more tests to be run, log in to bb,
su, su wpk, and remove any "failed" and "running" files:
rm /proj/build-reports/bind9/hosts/*/failed
rm /proj/build-reports/bind9/hosts/*/running
The "failed" file contains the time of failure, which is not
particularly useful. The more useful information is in the various
log files under the build report.

View File

@@ -1,171 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# branchsync:
# pull in changes from a main BIND 9 release branch to a subscription
# branch (e.g., from v9_9 to v9_9_sub). This excludes commits from the
# 'tinderbox' user (copyright updates and doc regeneration) because those
# will be taken care of in the subscription branch itself.
#
# Most of the time, changes in the main branch will cherry-pick cleanly
# into the subscription branch. When one fails, we reset to the last
# commit that went cleanly, and send mail -- or, if running in interactive
# mode, we stop and allow the user to resolve conflicts.
#
# NOTE: This does not push changes to the repository; currently that's up
# to the caller.
#
# Usage:
# branchsync.sh [ -i ] [ -c ]
# -i: interactive mode (don't reset and send mail)
# -c: continue (conflicts are resolved; edit message and commit)
restore_files () {
# restore the copyrights and api files
git checkout HEAD -- util/copyrights lib/*/api
# restore the generated documentation
git checkout HEAD -- doc/arm/*.html doc/arm/Bv9ARM.pdf
git checkout HEAD -- bin/*/*.html bin/*/*.[0-9]
# don't update the EXCLUDED file
if [ -f EXCLUDED ]; then
git checkout HEAD -- EXCLUDED
fi
}
savehash () {
cat <<EOF > $1.new
SOURCEBRANCH=$2
LASTHASH=$3
EOF
mv -f $1.new $1
git add branchsync.dat
}
thisbranch () {
git branch | grep '^\*' | cut -b3-
}
docommit () {
# skip the commit if we're only updating branchsync.dat
status=`git status -suno | grep branchsync.dat`
if [ -z "$status" ]; then
return
fi
# pull in the log message from the cherry-picked commit
git log -1 --pretty=format:%s%n%b $2 > orig_commit_msg.tmp
author=`git log -1 --pretty=format:"%aN <%aE>" $2`
firstline=`head -1 orig_commit_msg.tmp | sed 's/^\[[a-z0-9_]*\] //'`
tail -n +2 orig_commit_msg.tmp > remainder.tmp
firstline="[$BRANCH] $firstline"
echo $firstline > commit_msg.tmp
cat remainder.tmp >> commit_msg.tmp
echo "pulled from $1 by script." >> commit_msg.tmp
echo "hash: $2" >> commit_msg.tmp
msg=`cat commit_msg.tmp`
rm -f orig_commit_msg.tmp commit_msg.tmp remainder.tmp
# commit
git commit --no-verify --no-edit --author="$author" -m "$msg" || exit 1
}
BRANCH=`thisbranch`
if [ ! -f branchsync.dat ]; then
echo "$0: branchsync data file not found"
exit 0
fi
. branchsync.dat
# check arguments
interactive=
continuing=
case $1 in
'-i') interactive=yes
;;
'-c') docommit $SOURCEBRANCH $LASTHASH
interactive=yes
continuing=yes
;;
*) if [ $# -ne 0 ]; then
echo "Usage: $0 [ -i ] [ -c ]" 1>&2
exit 1
fi
;;
esac
if [ -z "$continuing" ]; then
status=`git status -suno`
if [ -n "$status" ]; then
echo "Work tree is not clean. Clean up, or run with -c:"
echo "$status"
exit 1
fi
# make sure both branches are synced to the source repository
git pull origin $BRANCH > /dev/null 2>&1
git checkout -f $SOURCEBRANCH > /dev/null 2>&1
git pull origin $SOURCEBRANCH > /dev/null 2>&1
git checkout -f $BRANCH > /dev/null 2>&1
fi
# loop through commits looking for ones that should be cherry-picked
git log $SOURCEBRANCH --first-parent --reverse --format='%H %aN' $LASTHASH..$SOURCEBRANCH | \
awk '$0 !~ /Tinderbox/ {print $1}' | {
while read hash; do
mainline=
if [ `git cat-file -p ${hash} | grep '^parent [0-9a-f][0-9a-f]*$' | wc -l` -gt 1 ]; then
mainline="-m 1 "
fi
if git cherry-pick ${mainline} -xn ${hash}; then
# cherry-pick was clean
# restore the files that we don't want updated automatically
restore_files
# note which hash we're merging
savehash branchsync.dat $SOURCEBRANCH $hash
# fix the commit message, and commit
docommit $SOURCEBRANCH $hash
# move on to the next commit
continue
elif [ -n "$interactive" ]; then
# interactive mode -- wait for user to fix things
# first restore the files that we don't want updated automatically
restore_files
# note which hash we're merging
savehash branchsync.dat $SOURCEBRANCH $hash
else
# noninteractive mode
# reset everything
git reset --hard
# build mail message
subject="Branch sync to $BRANCH failed"
cat << EOF > /tmp/branchmsg.$$
Attempt to cherry pick ${hash}
to $BRANCH failed.
Commit message of change was:
`git log -1 --pretty=format:%s%n%b ${hash}`
EOF
# send mail
cat /tmp/branchmsg.$$ | mail -s "$subject" bind-changes@isc.org
rm /tmp/branchmsg.$$
fi
break
done
}

View File

@@ -1,255 +0,0 @@
#! /usr/bin/perl -ws
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Rudimentary, primarily for use by the developers.
# This just evolved with no serious attempt at making it
# bulletproof or foolproof. Or pretty even. Probably would
# have done it differently if it were actually designed as opposed
# to just growing as a multi-tentacled thing as various messages
# were either added or selectively silenced.
use strict;
use vars qw($help $debug);
sub
sortdir() {
if (-d $::a) {
if (-d $::b) {
return ($::a cmp $::b);
} else {
return (-1);
}
} elsif (-d $::b) {
return (1);
} else {
return ($::a cmp $::b);
}
}
sub
do_dir($$) {
my($predir, $dir) = @_;
my $newdir = $predir ne "" ? "$predir/$dir" : $dir;
print "================> $newdir\n";
unless (chdir("$dir")) {
print "cd $newdir: $1\n";
return;
}
unless (opendir(DIR, ".")) {
print "opendir $predir/$dir: $!\n";
return;
}
foreach my $entry (sort sortdir readdir(DIR)) {
next if $entry =~ /^\.\.?$/;
if (-d $entry) {
do_dir($newdir, $entry);
next;
}
next if $entry !~ /\.o$/;
do_file($entry);
}
closedir(DIR);
chdir("..") or
die "major malfunction: can't chdir to parent dir: $!\n";
print "================> $predir\n";
}
sub
do_file($) {
my $objfile = $_[0];
my ($file, $savesource, $saveobj);
my ($config_h, $cpp_if, $prefix, $elided, $comment, $prefix_extend, $body);
unless ($objfile =~ /\.o$/) {
print "$0: skipping non-object file $objfile\n";
return;
}
($file = $objfile) =~ s%\.o$%.c%;
($savesource = $file) =~ s%$%.save%;
($saveobj = $objfile) =~ s%$%.save%;
if (-f $savesource) {
print "$savesource exists, skipping\n";
return;
}
unless (-f $file) {
print "$file does not exist, skipping\n";
return;
}
rename($file, $savesource);
rename($objfile, $saveobj);
open(SOURCE, "< $savesource");
$_ = join('', <SOURCE>);
close(SOURCE);
$prefix = '';
print "$file begin\n" if $debug;
while (1) {
eval {
# Note that only '#include <...>' is checked, not '#include "..."'.
# 1 23 4 5 6 78
if (m%(\A\Q$prefix\E((.*\n)*?))(\#include\s+(<.*?>)(.*)\n)((.*\n)*)%) {
$elided = $5;
$prefix_extend = $2 . $4;
$comment = $6;
$body = $1 . $7;
} else {
print "$file end\n" if $debug;
$elided = ""; # stop processing this file.
}
};
if ($@ ne "") {
print "$file processing failed: $@\n";
last;
}
last if $elided eq "";
print STDERR "$file checking $elided\n" if $debug;
if (! $config_h) {
$config_h = 1;
if ($elided ne "<config.h>") {
print "$file should include <config.h> before any other\n";
}
}
# Always required.
next if $elided eq "<config.h>";
# Can mark in the header file when a #include should stay even
# though it might not appear that way otherwise.
next if $comment =~ /require|provide|extend|define|contract|explicit/i;
if ($elided eq "<isc/print.h>") {
next if m%snprintf%m;
}
open(SOURCE, "> $file");
print SOURCE "$body";
close(SOURCE);
print "$file elided $elided, compiling\n" if $debug;
if (compile($objfile) == 0) {
if (! defined($cpp_if)) {
$cpp_if = /^#if/m;
print "$file has CPP #if(def), doublecheck elision recommendations.\n"
if $cpp_if;
}
print "$file does not need $elided\n";
} elsif ($elided eq "<string.h>") {
print "$file prefer <isc/string.h> to <string.h>\n";
}
} continue {
$prefix .= $prefix_extend;
}
rename($savesource, $file);
rename($saveobj, $objfile);
}
sub
compile($) {
my $obj = $_[0];
unless ($obj =~ /\.o$/) {
warn "$obj: not a .o object file\n";
return;
}
my $output = $debug ? "/dev/tty" : "/dev/null";
open(COMPILE, "make -e $obj 2>&1 >$output |");
my $stderr_lines = join('', <COMPILE>);
print $stderr_lines if $debug;
close(COMPILE);
unlink($obj);
return ($stderr_lines ne "");
}
sub
main() {
$| = 1;
$0 =~ s%.*/%%;
die "Usage: $0 [-debug]\n" if $help;
unless (-f 'configure' && -f 'Makefile') {
die "$0: run from top of bind9 source tree, after configure has run\n";
}
print "========================\n";
print "building initial objects\n";
print "========================\n";
# XXX bleah
unless (system("make") == 0) {
die "make all failed, couldn't be sure all objects were generated.\n";
}
unless (system("cd bin/tests && make -k all_tests") == 0) {
warn "make all_tests failed, but pressing on anyway\n";
}
print <<EOF;
================================================================
starting header elision
WARNING: Since this script only removes one header at a time,
programs might compile fine without the header because another
header provides the required information. If that header is
also recommend for removal, then removing both of them could
lead to a program that does *not* compile fine. So the only
way to be sure is to take them all out and then recompile to
see if there are any residual warnings/errors.
Similar, this program is quite ignorant when it comes to CPP
#if/#ifdef. It might well be that a header file does not
appear to be necessary because the code that depends on it
is not being compiled. To prevent this program from complaining
about such includes in later runs, put a "Required for ..."
comment on the same line as the #include.
================================================================
EOF
# XXX gcc-specific
# Disable builtin memcmp/memcpy/strcmp/strcpy/etc. When they are
# available, gcc won't warn about the lack of a prototype in a header
# file.
$ENV{'CFLAGS'} = "-fno-builtin";
do_dir("", ".");
}
main();

View File

@@ -1,18 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
ps=`git log -1 --date=raw --pretty=format:%ad -- doc/arm/Bv9ARM.pdf | awk '{print $1;}'`
for f in doc/arm/*.html
do
ts=`git log -1 --date=raw --pretty=format:%ad -- $f | awk '{print $1;}'`
if test ${ts:-0} -gt ${ps:-0}
then
echo commit needed.
fi
done

View File

@@ -1077,13 +1077,9 @@
./doc/design/verify TXT.BRIEF 2012,2016,2018,2019,2020,2021
./doc/design/zone TXT.BRIEF 1999,2000,2001,2004,2016,2018,2019,2020,2021
./doc/dev/DBC TXT.BRIEF 1999,2000,2001,2004,2016,2018,2019,2020,2021
./doc/dev/autoconf TXT.BRIEF 2001,2002,2004,2016,2018,2019,2020,2021
./doc/dev/cvs-usage TXT.BRIEF 2000,2001,2004,2016,2018,2019,2020,2021
./doc/dev/magic_numbers TXT.BRIEF 1999,2000,2001,2002,2004,2016,2018,2019,2020,2021
./doc/dev/rdata.md MKD 1999,2000,2001,2004,2007,2016,2017,2018,2019
./doc/dev/release TXT.BRIEF 2000,2001,2002,2003,2004,2005,2006,2007,2009,2014,2016,2018,2019,2020,2021
./doc/dev/results TXT.BRIEF 1999,2000,2001,2004,2016,2018,2019,2020,2021
./doc/dev/tests TXT.BRIEF 2000,2001,2004,2016,2018,2019,2020,2021
./doc/dev/unexpected TXT.BRIEF 1999,2000,2001,2004,2016,2018,2019,2020,2021
./doc/dnssec-guide/advanced-discussions.rst RST 2021
./doc/dnssec-guide/commonly-asked-questions.rst RST 2021
@@ -1972,7 +1968,6 @@
./util/COPYRIGHT.PORTION X 1996,1997,1998,1999,2000,2001,2004,2007,2016,2018,2019,2020,2021
./util/COPYRIGHT.TOP X 2018,2019,2020,2021
./util/bindkeys.pl PERL 2009,2010,2011,2012,2014,2016,2017,2018,2019,2020,2021
./util/branchsync.sh SH 2013,2016,2018,2019,2020,2021
./util/check-categories.sh SH 2015,2016,2017,2018,2019,2020,2021
./util/check-changes PERL 2002,2004,2007,2012,2016,2018,2019,2020,2021
./util/check-cocci X 2018,2019,2020,2021
@@ -1981,14 +1976,9 @@
./util/check-line-length.sh SH 2021
./util/check-make-install.in SH 2020
./util/check-pullups.pl PERL 2001,2002,2003,2004,2007,2012,2016,2018,2019,2020,2021
./util/check-sources.pl PERL 2000,2001,2004,2007,2012,2013,2016,2018,2019,2020,2021
./util/checklibs.sh SH 2017,2018,2019,2020,2021
./util/commit-arm.sh SH 2012,2016,2018,2019,2020,2021
./util/copyrights X 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./util/git-replay-merge.sh SH 2018,2019,2020,2021
./util/kit.sh SH 2000,2001,2002,2003,2004,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./util/mandoc2docbook.pl PERL 2001,2004,2007,2012,2016,2018,2019,2020,2021
./util/mdnbuildtest.sh SH 2000,2001,2004,2007,2012,2016,2018,2019,2020,2021
./util/memleak.pl PERL 1999,2000,2001,2004,2007,2012,2016,2018,2019,2020,2021
./util/merge_copyrights PERL 1998,1999,2000,2001,2003,2004,2005,2006,2007,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./util/models.c C 2015,2016,2017,2018,2019,2020,2021
@@ -1997,9 +1987,6 @@
./util/pairwise-testing.sh SH 2020,2021
./util/parse_tsan.py PYTHON-BIN 2019,2020,2021
./util/run-clang-tidy X 2020,2021
./util/spacewhack.pl PERL 2000,2001,2004,2007,2012,2016,2018,2019,2020,2021
./util/tabify-changes SH 2004,2007,2012,2016,2018,2019,2020,2021
./util/unused-headers.sh SH 2020,2021
./util/update-drafts.pl PERL 2000,2001,2004,2007,2012,2016,2018,2019,2020,2021
./util/update_branches PERL 2005,2007,2012,2016,2018,2019,2020,2021
./util/update_copyrights PERL 1998,1999,2000,2001,2004,2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021

View File

@@ -1,202 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Make a release kit
#
# Usage: sh kit.sh tag tmpdir
#
# (e.g., sh kit.sh v9_0_0b5 /tmp/bindkit
#
# To build a snapshot release, use the pseudo-tag "snapshot".
#
# (e.g., sh kit.sh snapshot /tmp/bindkit
#
remote=--remote=git@gitlab.isc.org:isc-projects/bind9.git
case "${1:-}" in
--remote=*)
remote="${1}"
shift
;;
esac
repo=`expr "X${remote}X" : '^X--remote=\(.*\)X$'`
case $# in
3)
case "$1" in
snapshot) ;;
*) echo "usage: sh kit.sh [snapshot] gittag tmpdir" >&2
exit 1
;;
esac
snapshot=true;
releasetag=$2
tag=$2
tmpdir=$3
;;
2)
tag=$1
tmpdir=$2
case $tag in
snapshot) tag=master; snapshot=true ; releasetag="" ;;
*) snapshot=false ;;
esac
;;
*) echo "usage: sh kit.sh [snapshot] gittag tmpdir" >&2
exit 1
;;
esac
# create tmpdir
test -d $tmpdir ||
mkdir $tmpdir || {
echo "$0: could not create directory $tmpdir" >&2
exit 1
}
cd $tmpdir || {
echo "$0: cd $tmpdir failed"
exit 1
}
hash=`git ls-remote $repo refs/heads/$tag | awk '{print $1}'`
if [ -z "$hash" ]; then
hash=`git ls-remote $repo refs/tags/$tag | awk '{print $1}'`
fi
if [ -z "$hash" ]; then
echo "Unable to determine hash for $tag, aborting."
exit 1
fi
shorthash=`echo $hash | cut -c1-7`
verdir=bind9-kit.$$
mkdir $verdir || {
echo "$0: could not create directory $tmpdir/$verdir" >&2
exit 1
}
git archive --format=tar $remote $tag version | ( cd $verdir ;tar xf - )
test -f $verdir/version || {
echo "$0: could not get 'version' file" >&2
exit 1
}
. $verdir/version
rm $verdir/version
rmdir $verdir
if $snapshot
then
RELEASETYPE=s
RELEASEVER=${shorthash}
fi
version=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}
echo "building release kit for BIND version $version, hold on..."
topdir=bind-$version
test ! -d $topdir || {
echo "$0: directory $tmpdir/$topdir already exists" >&2
exit 1
}
mkdir $topdir || exit 1
git archive --format=tar $remote $tag | ( cd $topdir; tar xf -)
cd $topdir || exit 1
if $snapshot
then
cat <<EOF >version
MAJORVER=$MAJORVER
MINORVER=$MINORVER
PATCHVER=$PATCHVER
RELEASETYPE=$RELEASETYPE
RELEASEVER=$RELEASEVER
EXTENSIONS=$EXTENSIONS
EOF
fi
# Omit some files and directories from the kit.
#
# Some of these directories (doc/html, doc/man...) no longer
# contain any files and should therefore be absent in the
# checked-out tree, but they did exist at some point and
# we still delete them from releases just in case something
# gets accidentally resurrected.
rm -rf TODO EXCLUDED conftools doc/design doc/dev doc/draft doc/expired \
doc/html doc/rfc doc/todo doc/private doc/man doc/markdown \
contrib/zkt/doc/rfc5011.txt \
bin/tests/system/relay lib/cfg
# Remove everything but mksymtbl.pl and bindkeys.pl from util
find util -name bindkeys.pl -o -name mksymtbl.pl -prune -o -type f -print | xargs rm -f
find util -depth -type d -print | xargs rmdir 2>/dev/null
# Remove all .gitignore files
find . -name .gitignore -print | xargs rm
# Remove branchsync.dat, if present
rm -f branchsync.dat
# populate srcid file
echo "SRCID=$shorthash" > srcid
# The following files should be executable.
chmod +x configure install-sh mkinstalldirs bin/tests/system/ifconfig.sh
# Fix up releases with libbind.
if test -f lib/bind/configure
then
chmod +x lib/bind/configure lib/bind/mkinstalldirs
fi
# check that documentation has been updated properly; issue a warning
# if it hasn't
ok=
for f in doc/arm/*.html
do
if test "$f" -nt doc/arm/Bv9ARM-book.xml
then
ok=ok
fi
done
if test "$ok" != ok
then
echo "WARNING: ARM source is newer than the html version."
fi
if test doc/arm/Bv9ARM-book.xml -nt doc/arm/Bv9ARM.pdf
then
echo "WARNING: ARM source is newer than the PDF version."
fi
for f in `find . -name "*.docbook" -print`
do
docbookfile=$f
htmlfile=${f%.docbook}.html
if test $docbookfile -nt $htmlfile
then
echo "WARNING: $docbookfile is newer than the html version."
fi
done
# build the tarball
cd .. || exit 1
kit=$topdir.tar.gz
tar -c -f - $topdir | gzip > $kit
echo "done, kit is in `pwd`/$kit"

View File

@@ -1,230 +0,0 @@
#!/usr/bin/perl
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Do a quick-and-dirty conversion of .mandoc man pages to
# DocBook SGML.
#
# Minor hand editing of the output is usually required.
# This has only been tested with library function man pages
# (section 3); it probably does not work well for program
# man pages.
#
print <<\END;
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<!--
- Copyright (C) 2000, 2001 Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<refentry>
<refentryinfo>
END
my $cursection = undef;
my $in_para = 0;
sub begin_para() {
if (! $in_para) {
print "<para>\n";
$in_para = 1;
}
}
sub end_para() {
if ($in_para) {
print "</para>\n";
$in_para = 0;
}
}
sub end_section {
if ($cursection) {
print "</$cursection>\n"
}
}
sub section {
my ($tag) = @_;
end_para();
end_section();
print "<$tag>\n";
$cursection = $tag;
}
my %tagmap = (
Er => errorcode,
Dv => type,
Pa => filename,
Li => constant, # XXX guess
Ar => parameter,
Va => parameter,
);
while (<>) {
next if m/^\.\\\"/;
if (/^\.Dd (.*)$/) {
print "<date>$1<\/date>\n<\/refentryinfo>\n";
next;
}
elsif (/^\.Dt ([^ ]+) ([^ ]+)$/) {
my $title = lc $1;
my $volume = $2;
chomp $volume;
print <<END;
<refmeta>
<refentrytitle>$title</refentrytitle>
<manvolnum>$volume</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
END
next;
}
elsif (/^\.Os (.*)$/) {
next;
}
elsif (/^\.ds (.*)$/) {
next;
}
elsif (/^\.Nm (.*)$/) {
if ($cursection eq "refnamediv") {
my $t = $1;
$t =~ s/ ,$//;
print "<refname>$t<\/refname>\n";
} else {
print "<command>$1<\/command>\n";
}
next;
}
elsif (/^\.Nd (.*)$/) {
print "<refpurpose>$1</refpurpose>\n";
next;
}
elsif (/^\.Sh NAME/) { section("refnamediv"); next; }
elsif (/^\.Sh SYNOPSIS/) { section("refsynopsisdiv"); next; }
elsif (/^\.Sh (.*)$/) {
section("refsect1");
print "<title>$1</title>\n"; next;
}
# special: spaces can occur in arg
elsif (/^\.Fd (.*)$/) {
$_ = $1;
s/</&lt;/g;
s/>/&gt;/g;
print "<funcsynopsisinfo>$_<\/funcsynopsisinfo>\n";
next;
}
elsif (/^\.Fn (.*?)( ([^"]+))?$/) {
# special: add parenthesis
print "<function>$1()<\/function>$3\n";
}
elsif (/^\.Op Fl (.*?)( ([^"]+))?$/) {
# special: add dash
print "<option>-$1<\/option>$3\n";
}
elsif (/^\.Fl (.*?)( ([^"]+))?$/) {
# special: add dash
print "<option>-$1<\/option>$3\n";
}
elsif (/^\.Ft (.*)$/) {
print "<funcprototype>\n";
print "<funcdef>\n";
print "$1\n";
next;
}
elsif (/^\.Fa (.*?)( ([^"]+))?$/) {
if ($cursection eq "refsynopsisdiv") {
my $t = $1;
$t =~ s/^"//;
$t =~ s/"$//;
print "<paramdef>$t<\/paramdef>\n";
} else {
print "<parameter>$1<\/parameter>$3\n";
}
next;
}
elsif (/^\.Fo (.*)$/) {
print "<function>$1<\/function></funcdef>\n";
next;
}
elsif (/^\.Xr ([^ ]+) ([^ ]+)( ([^ ]+))?$/) {
print "<citerefentry>\n";
print "<refentrytitle>$1</refentrytitle><manvolnum>$2</manvolnum>\n";
print "</citerefentry>$4\n";
next;
}
elsif (/^\.([A-Z][a-z]) (.*?)( ([^"]+))?$/ && defined($tagmap{$1})) {
my $tag = $tagmap{$1};
my $t = $2;
my $punct = $4;
$t =~ s/^"//;
$t =~ s/"$//;
$t =~ s/</&lt;/g;
$t =~ s/>/&gt;/g;
print "<$tag>$t<\/$tag>$punct\n";
next;
}
elsif (/^\.Fc$/) {
print "</funcprototype>\n";
next;
}
elsif (/^\.Pp$/) {
end_para();
begin_para();
}
elsif (/^\.Bd /) {
print "<programlisting>\n";
}
elsif (/^\.Ed$/) {
print "</programlisting>\n";
}
elsif (/^\.Bl /) {
print "<variablelist>\n";
}
elsif (/^\.El$/) {
print "</para>\n";
print "</listitem>\n";
print "</variablelist>\n";
$in_list = 0;
}
elsif (/^\.It .. (.*)$/) {
if ($in_list) {
print "</listitem>\n";
}
print "<varlistentry><term><constant>$1</constant></term>\n";
print "<listitem>\n";
print "<para>\n";
$in_list = 1;
}
elsif (/^\.It Dv (.*)$/) {
if ($in_list) {
print "</listitem>\n";
}
print "<varlistentry><term><errorcode>$1</errorcode></term>\n";
print "<listitem>\n";
print "<para>\n";
$in_list = 1;
} else {
if (/./) {
begin_para();
}
print;
}
}
end_para();
end_section();
print "</refentry>\n";

View File

@@ -1,65 +0,0 @@
#! /bin/sh -ex
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# XXXDCL This is currently much too specific to the environment in which
# it was written (NetBSD 1.5_alpha2 with libiconv in /usr/local/lib). It
# is essentially just a copy of the commands I used to test building of
# the mdnkit contributed source, and needs to be better generalized.
# Directory was prepared with:
# cvs export -r {tag} bind9
# cd bind9
sh -ex util/sanitize_all.sh
mdn=`pwd`/contrib/idn/mdnkit
set +e
patch -p0 < $mdn/patch/bind9/patch.most > patch.out 2>&1
set -e
cmd="egrep '^Hunk' patch.out | egrep -v '^Hunk #[0-9]+ succeeded at [0-9]+\.$'"
if eval $cmd | egrep -q .; then
echo Patch was not entirely clean: >&2
$cmd >&2
echo Patch output is in patch.out. >&2
exit 1
fi
cd $mdn
CFLAGS=-I/usr/local/include ./configure --with-iconv='-L/usr/local/lib -liconv'
make
cd ../../..
cp configure configure.orig
autoconf
set +e
diff -u2 ./configure.orig ./configure > $mdn/patch/bind9/patch.configure
set -e
make
make distclean > /dev/null 2>&1
mdntmp=tmp/mdn
rm -rf $mdntmp
mkdir -p $mdntmp/lib $mdntmp/include
cp $mdn/lib/.libs/libmdn.so $mdntmp/lib
cp -r $mdn/include/mdn $mdntmp/include
./configure --with-mdn=$mdntmp --with-iconv="-L/usr/local/lib -liconv"
LD_LIBRARY_PATH=/usr/local/lib:$mdntmp/lib:/usr/lib make
exit 0

View File

@@ -1,64 +0,0 @@
#!/usr/local/bin/perl -w
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
$0 =~ s%.*/%%;
if (@ARGV != 0) {
warn "Usage: $0 < list-of-files\n";
warn "The util/copyrights file is normally used for list-of-files.\n";
exit(1);
}
$total = 0;
printf "Lines Trimmed:\n";
while (defined($line = <STDIN>)) {
($file) = split(/\s+/, $line, 2);
# These are binary and must be ignored.
next if $file =~ m%/random.data|\.gif$%;
next if -B $file;
print "$file\n";
unless (open(FILEIN, "< $file")) {
warn "$0: open < $file: $!, skipping\n";
next;
}
undef $/; # Slurp whole file.
$_ = <FILEIN>;
$/ = "\n"; # Back to line-at-a-time for <FILES>.
close(FILEIN);
$count = s/[ \t]+$//mg;
next unless $count > 0;
unless (open(FILEOUT, "> $file")) {
warn "$0: open > $file: $!, skipping\n";
next;
}
print FILEOUT or die "$0: printing to $file: $!, exiting\n";
close FILEOUT or die "$0: closing $file: $!, exiting\n";
printf("%6d lines trimmed in $file\n", $count) if $count > 0;
$total += $count;
}
printf "%6d TOTAL\n", $total;
exit(0);

View File

@@ -1,35 +0,0 @@
#!/usr/local/bin/perl -w
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Replace internet drafts with updated versions, if any.
#
# Usage:
#
# cd doc/draft
# perl ../../util/update-drafts.pl *.txt
# (ignore "404 Not Found" errors from FTP)
# cvs commit -m"updated drafts"
#
foreach (@ARGV) {
$ofile = $_;
if (/^(.*-)([0-9][0-9])(\.txt)/) {
$nfile = "$1" . sprintf("%02d", $2 + 1) . "$3";
print $nfile, "\n";
system "ftp http://www.ietf.org/internet-drafts/$nfile";
if ($? == 0) {
unlink($ofile);
system "cvs remove $ofile";
system "cvs add $nfile";
}
}
}

View File

@@ -1,218 +0,0 @@
#!/usr/local/bin/perl -w
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Track which branches are still open or not in the bind9 cvs repository.
# This is done so that work that is "in progress" (active) doesn't get
# so easily forgotten about.
#
# This script updates doc/private/branches by adding new branches and moving
# closed branches to the end of the file. New branches are found by walking
# the cvs repository and extracting the new branches from the header fields
# of the files there.
#
# doc/private/branches has one line per branch in the following field order:
# name, status, to whom the branch belongs and comments. Comments are
# in '(',')'. The first three field are single words.
#
# Note: this is intended to be run on the machine hosting the CVS repository.
#
%branches = ();
%whom = ();
%comments = ();
%history = ();
%dates = ();
$repository = "/proj/cvs/prod";
$module = "bind9";
#
# Make sure we have a up to date copy. If the previous ran failed for
# any reason remove it (-C).
#
!system("cvs", "-d", $repository, "update", "-C", "doc/private/branches") || die "cannot update doc/private/branches: $!";
#
# load existing content
#
open(BRANCHES, "<doc/private/branches") || die "can't open util/branches: $!";
while (<BRANCHES>) {
my $branch;
my $status;
my $who;
chomp;
next if (/^-/);
next if (/^Branch/);
next if (/^\s/);
$c = "";
if (m://.*:) {
$c = $_;
$c =~ s:.*?//\s*(.*)$:$1:;
s:(.*?)//.*:$1:;
} else {
#
# look for old style comment
#
if (m/\(.*\)/) {
$c = $_;
$c =~ s/.*\((.*)\).*$/$1/;
s/\(.*\)//;
}
}
s/\s*$//;
next if (/^\s*$/);
($branch, $status, $who) = split;
$status = "new" if (!defined($status));
$branches{$branch} = $status;
$who = "" if (!defined($who));
$whom{$branch} = $who;
$comments{$branch} = $c;
}
close (BRANCHES);
# T 1999-03-15 21:15 +0000 vixie bind [ietf44:A]
open(HISTORY, "cvs history -T -a 2> /dev/null |") || die("can't get history");
while (<HISTORY>) {
my $tag;
my $date;
my $time;
my $tz;
my $who;
my $mod;
my $branch;
chomp;
s/[][]//g;
s/:[^ \t]+$//;
s/\s+/ /g;
($tag, $date, $time, $tz, $who, $mod, $branch) = split;
next if ($mod ne $module );
next if ($tag ne "T" );
next if (exists($history{$branch}));
$history{$branch} = $who;
$dates{$branch} = "$date $time $tz";
# print "$_\n";
}
close (HISTORY);
#
# Search repository for new branches.
#
# New branches have the following format "name:<revision>.0.#"
# where # is the number of potential branches from this the revision.
#
open(FILES, "find $repository/$module -type f -name *,v -print |") || die "can't start find: $!";
while (<FILES>) {
chomp;
# print "file: $_\n"; # debug
# $file = $_; # save for branch debug below.
s:^$repository/::;
s:/Attic/([^/]*)$:/$1:;
s:,v$::;
#
# use cvs so that the file is locked.
#
#print "cvs -d $repository rlog -h $_\n";
open(FILE, "cvs -d $repository rlog -h $_|") || die "can't start cvs rlog -h $_: $!";
while (<FILE>) {
chomp;
next unless m/^symbolic names:$/; # skip until we find the tags
while (<FILE>) {
chomp;
last if (m/^locks;/); # we are past the tags
last if (m/^keyword/); # we are past the tags
next unless m/\.0\.\d+$/; # skip if not a branch
s/\s(.*):.*/$1/; # extract label
if (!$branches{$_}) {
$branches{$_} = "new";
if (exists($history{$_})) {
$whom{$_} = $history{$_};
$comments{$_} = $dates{$_};
} else {
$whom{$_} = "";
$comments{$_} = "";
}
# print "branch: $_ $file\n"; # debug
}
}
chomp while (<FILE>); # let cvs rlog exit normally.
}
close(FILE);
}
close(FILES);
#
# Write out updated version.
#
open(BRANCHES, ">doc/private/newbranches") || die "can't open doc/private/branches: $!";
print BRANCHES "\nBranch\t\t\t\tStatus\tWhom\t// Comments\n";
print BRANCHES "-----------------------------------------------------------\n\n";
print BRANCHES "\t\t\t\tnew\t\tnot yet classified\n";
print BRANCHES "\t\t\t\topen\t\tdevelopement branch\n";
print BRANCHES "\t\t\t\tactive\t\tnot a development branch\n";
print BRANCHES "\t\t\t\treview\t\tready for review\n";
print BRANCHES "\t\t\t\tprivate\t\tprivate branch\n";
print BRANCHES "\t\t\t\tclosed\t\tfinished with\n";
print BRANCHES "\n";
foreach $key (sort keys %branches) {
next if ($branches{$key} eq "closed");
print BRANCHES "$key";
$len = length($key);
if ($len >= 32) {
$tabs = 1;
} else {
$needed = int (32 - $len);
$tabs = int ($needed / 8);
if ($needed % 8 != 0) {
$tabs++;
}
}
for ($i = 0; $i < $tabs; $i++) {
printf BRANCHES "\t";
}
print BRANCHES "$branches{$key}\t";
print BRANCHES "$whom{$key}";
print BRANCHES "\t// $comments{$key}" if ($comments{$key} ne "");
print BRANCHES "\n";
}
print BRANCHES "\n\n";
foreach $key (sort keys %branches) {
next if ($branches{$key} ne "closed");
print BRANCHES "$key";
$len = length($key);
if ($len >= 32) {
$tabs = 1;
} else {
$needed = int (32 - $len);
$tabs = int ($needed / 8);
if ($needed % 8 != 0) {
$tabs++;
}
}
for ($i = 0; $i < $tabs; $i++) {
printf BRANCHES "\t";
}
print BRANCHES "$branches{$key}";
print BRANCHES "\t\t// $comments{$key}" if ($comments{$key} ne "");
print BRANCHES "\n";
}
close(BRANCHES);
#
# Update if changed.
#
if (system("cmp", "-s", "doc/private/newbranches", "doc/private/branches")) {
rename("doc/private/newbranches", "doc/private/branches") || die "Cannot rename: doc/private/newbranches -> doc/private/branches: $!";
!system("cvs", "-d", $repository, "commit", "-m", "auto update", "doc/private/branches") || die "cvs commit failed: $!";
} else {
unlink("doc/private/newbranches");
}