mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-29 18:09:11 -04:00
Removed the sanitation stuff, thereby speeding up building
of release kits several times
This commit is contained in:
parent
9066d09c3e
commit
d9edf3ad42
4 changed files with 1 additions and 276 deletions
|
|
@ -2222,8 +2222,6 @@
|
|||
./util/mkreslib.pl PERL 2000,2001
|
||||
./util/nanny.pl PERL 2000,2001
|
||||
./util/nt-kit SH 1999,2000,2001
|
||||
./util/sanitize.pl PERL 2000,2001
|
||||
./util/sanitize_all.sh SH 2000,2001
|
||||
./util/spacewhack.pl PERL 2000,2001
|
||||
./util/update-drafts.pl PERL 2000,2001
|
||||
./util/update_copyrights PERL 1998,1999,2000,2001
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: kit.sh,v 1.20 2001/05/30 21:18:07 bwelling Exp $
|
||||
# $Id: kit.sh,v 1.21 2001/10/01 20:41:25 gson Exp $
|
||||
|
||||
# Make a release kit
|
||||
#
|
||||
|
|
@ -87,8 +87,6 @@ RELEASEVER=$RELEASEVER
|
|||
EOF
|
||||
fi
|
||||
|
||||
sh util/sanitize_all.sh
|
||||
|
||||
# Omit some files and directories from the kit.
|
||||
#
|
||||
# Some of these directories (doc/html, doc/man...) no longer
|
||||
|
|
|
|||
235
util/sanitize.pl
235
util/sanitize.pl
|
|
@ -1,235 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: sanitize.pl,v 1.15 2001/01/09 22:00:58 bwelling Exp $
|
||||
|
||||
# Don't try and sanitize this file: NOMINUM_IGNORE
|
||||
|
||||
# Go through the directory tree and make sure that all of the files are
|
||||
# sanitized.
|
||||
#
|
||||
# In normal mode, check file, removing code between
|
||||
# #ifndef key
|
||||
# and the accompanying #else or #endif. Similarly, code in an #else
|
||||
# clause after an #ifndef test will be removed. The #else or #endif's
|
||||
# must appear as:
|
||||
# #else /* key */
|
||||
# #endif /* key */
|
||||
# Balance is tested.
|
||||
# Non-.c/.h files are tested for the existance of NOMINUM_anything anywhere
|
||||
# in the file, and a warning is generated, unless the string
|
||||
# NOMINUM_IGNORE appears before NOMINUM_.
|
||||
|
||||
# If the string key_DELETE is present, delete the file when the key
|
||||
# is present.
|
||||
|
||||
# If the string key_KEEP is present, delete the file when the key
|
||||
# is absent.
|
||||
|
||||
# Usage:
|
||||
# ./sanitize.pl -c - Check syntax only, don't change anything
|
||||
# ./sanitize.pl -kkey - Sanitize against key
|
||||
# ./sanitize.pl -ikey - Reverse sense of sanitize.
|
||||
# ./sanitize.pl - - Work as a pipe, sanitizing stdin to stdout.
|
||||
# ./sanitize.pl file - Sanitize the specified file.
|
||||
|
||||
$makechange = 1;
|
||||
$debug = 0;
|
||||
$curkeys = 0;
|
||||
|
||||
# States:
|
||||
# 0 - Outside of test, include code
|
||||
# 1 - Inside NOMINUM_PUBLIC
|
||||
# 2 - Inside !NOMINUM_PUBLIC
|
||||
|
||||
foreach $arg (@ARGV) {
|
||||
$_ = $arg;
|
||||
if (/^-c$/i) {
|
||||
$makechange = 0;
|
||||
}
|
||||
elsif (/^-k(.*)$/i) {
|
||||
$showon[$curkeys] = 1;
|
||||
$state[$curkeys] = 0;
|
||||
$key[$curkeys++] = $1;
|
||||
}
|
||||
elsif (/^-i(.*)$/i) {
|
||||
$showon[$curkeys] = 2;
|
||||
$state[$curkeys] = 0;
|
||||
$key[$curkeys++] = $1;
|
||||
}
|
||||
elsif (/^-$/i) {
|
||||
&runfile("-","-");
|
||||
}
|
||||
# elsif (/^-a$/i) {
|
||||
# &rundir();
|
||||
# }
|
||||
elsif (/^-d$/i) {
|
||||
$debug = 1;
|
||||
}
|
||||
else {
|
||||
&runfile($arg, $arg.".sanitize");
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
|
||||
|
||||
sub runfile($) {
|
||||
for ($i = 0 ; $i < $curkeys; $i++) {
|
||||
$state[$i] = 0;
|
||||
}
|
||||
$deletefile = 0;
|
||||
|
||||
open(INFILE, $_[0]) || die ("$_[0]");
|
||||
open(OUTFILE, ">$_[1]") || die ("$_[1]")
|
||||
if ($makechange);
|
||||
while (<INFILE>) {
|
||||
if (/NOMINUM_IGNORE/) {
|
||||
close(INFILE);
|
||||
close(OUTFILE);
|
||||
unlink($_[1]);
|
||||
last;
|
||||
}
|
||||
$masterstate = 0;
|
||||
$intest = 0;
|
||||
for ($i = 0 ; $i < $curkeys; $i++) {
|
||||
if ((/$key[$i]_DELETE/) &&
|
||||
($showon[$i] == 1)) {
|
||||
close(INFILE);
|
||||
close(OUTFILE);
|
||||
unlink($_[1]);
|
||||
$deletefile = 1;
|
||||
goto bailout;
|
||||
}
|
||||
elsif ((/$key[$i]_KEEP/) &&
|
||||
($showon[$i] == 2)) {
|
||||
close(INFILE);
|
||||
close(OUTFILE);
|
||||
unlink($_[1]);
|
||||
$deletefile = 1;
|
||||
goto bailout;
|
||||
}
|
||||
elsif (/\#.*ifdef.+$key[$i]/) {
|
||||
if ($state[$i] != 0) {
|
||||
print(STDERR "*** ERROR in file ".
|
||||
"$_[0] line $.: ".
|
||||
"#ifdef within unterminated ".
|
||||
"if[n]def ($key[$i])\n");
|
||||
close(INFILE);
|
||||
close(OUTFILE) if ($makechange);
|
||||
unlink($_[1]);
|
||||
goto bailout;
|
||||
}
|
||||
$masterstate++;
|
||||
$state[$i] = 1;
|
||||
goto doneline;
|
||||
}
|
||||
elsif (/\#.*ifndef.+$key[$i]/) {
|
||||
if ($state[$i] != 0) {
|
||||
print(STDERR "*** ERROR in file ".
|
||||
"$_[0] line $.: ".
|
||||
"#ifndef within unterminated ".
|
||||
"if[n]def ($key[$i])\n");
|
||||
close(INFILE);
|
||||
close(OUTFILE) if ($makechange);
|
||||
unlink($_[1]);
|
||||
last;
|
||||
}
|
||||
$masterstate++;
|
||||
$state[$i] = 2;
|
||||
goto doneline;
|
||||
|
||||
}
|
||||
elsif (/\#.*else.+$key[$i]/) {
|
||||
if ($state[$i] == 0) {
|
||||
print(STDERR "*** ERROR in file ".
|
||||
"$_[0] line $.: ".
|
||||
"#else without matching ".
|
||||
"#if[n]def. ($key[$i])\n");
|
||||
close(INFILE);
|
||||
close(OUTFILE) if ($makechange);
|
||||
unlink($_[1]);
|
||||
last;
|
||||
}
|
||||
$masterstate++;
|
||||
if ($state[$i] == 1) {
|
||||
$state[$i] = 2;
|
||||
} else {
|
||||
$state[$i] = 1;
|
||||
}
|
||||
goto doneline;
|
||||
}
|
||||
elsif (/\#.*endif.+$key[$i]/) {
|
||||
if ($state[$i] == 0) {
|
||||
print(STDERR "*** ERROR in file ".
|
||||
"$_[0] line $.: ".
|
||||
"#endif without matching ".
|
||||
"#if[n]def. ($key[$i])\n");
|
||||
close(INFILE);
|
||||
close(OUTFILE) if ($makechange);
|
||||
unlink($_[1]);
|
||||
last;
|
||||
}
|
||||
$masterstate++;
|
||||
$state[$i] = 0;
|
||||
goto doneline;
|
||||
}
|
||||
}
|
||||
doneline:
|
||||
for ($i = 0 ; $i < $curkeys; $i++) {
|
||||
if ($state[$i] != 0) {
|
||||
$intest++;
|
||||
}
|
||||
if (($state[$i] != 0) &&
|
||||
($state[$i] != $showon[$i])) {
|
||||
$masterstate++;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (($masterstate == 0) && $makechange) {
|
||||
if ($intest != 0) {
|
||||
if (/^#\+(.*)/) {
|
||||
print(OUTFILE "$1\n");
|
||||
} else {
|
||||
print(OUTFILE);
|
||||
}
|
||||
} else {
|
||||
print(OUTFILE);
|
||||
}
|
||||
}
|
||||
}
|
||||
bailout:
|
||||
$masterstate = 0;
|
||||
for ($i = 0 ; $i < $curkeys; $i++) {
|
||||
if ($state[$i] != 0) {
|
||||
print(STDERR "*** ERROR in file $_[0]: ".
|
||||
"file ended with unterminated test. ".
|
||||
"$key[$i]\n");
|
||||
$masterstate++;
|
||||
}
|
||||
}
|
||||
if ($masterstate == 0) {
|
||||
close(INFILE);
|
||||
close(OUTFILE) if ($makechange);
|
||||
if (($_[0] ne "-") && ($makechange)) {
|
||||
unlink($_[0]) || die "unlink $_[0]:";
|
||||
if (!$deletefile) {
|
||||
rename($_[1], $_[0]) ||
|
||||
die "rename $_[1] to $_[0]:";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2000, 2001 Internet Software Consortium.
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
# $Id: sanitize_all.sh,v 1.11 2001/01/09 22:01:01 bwelling Exp $
|
||||
|
||||
PERL=perl5
|
||||
|
||||
# Run this shell script from a CVS export'ed source tree, and it will
|
||||
# sanitize all of the files in that tree.
|
||||
|
||||
SANITIZE_FLAGS="-kNOMINUM_PUBLIC -iDNS_OPT_NEWCODES -iDNS_OPT_NEWCODES_LIVE"
|
||||
|
||||
find . -name '*.[ch]' -o -name '*.in' |
|
||||
xargs $PERL util/sanitize.pl $SANITIZE_FLAGS
|
||||
|
||||
for file in `find . -name '*.dirty'`
|
||||
do
|
||||
clean=`echo $file | sed 's/\.dirty$//'`
|
||||
$PERL util/sanitize.pl $SANITIZE_FLAGS - < $file > $clean
|
||||
rm $file
|
||||
done
|
||||
|
||||
Loading…
Reference in a new issue