From d6da642b67fe0670fd0bdd4424049f753ac6d87e Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 1 Aug 2000 15:25:07 +0000 Subject: [PATCH] Use the copyrights file (or other list of files) as inputer rather than using a find command to generate the files to update. this skips doc/drafts, doc/rfc, lib/dns/sec/dnssafe, lib/dns/sec/openssl and any other files we do not make changes to. --- util/spacewhack.pl | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/util/spacewhack.pl b/util/spacewhack.pl index 801f89ce1f..00a74cf663 100644 --- a/util/spacewhack.pl +++ b/util/spacewhack.pl @@ -15,46 +15,34 @@ # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# $Id: spacewhack.pl,v 1.1 2000/08/01 00:51:14 tale Exp $ +# $Id: spacewhack.pl,v 1.2 2000/08/01 15:25:07 tale Exp $ $0 =~ s%.*/%%; -$find = "find . -type f -print"; - -open(FILES, "$find | sort |") - or die "can't start \"$find\": $!"; +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($file = )) { - chomp $file; +while (defined($line = )) { + ($file) = split(/\s+/, $line, 2); - # Cheap test for files to ignore. - next if $file =~ m%/\.#%; # CVS conflict files. - next if $file =~ m%/CVS/%; # CVS metafiles. - next if $file =~ m%\.[oa]$%; # Object and library files. - next if $file =~ m%/#[^/]+#$%; # Emacs autosave. - next if $file =~ m%~([0-9]+~)?$%; # Emacs version control. + # These are binary and must be ignored. + next if $file =~ m%/random.data|\.gif$%; + next if -B $file; - # Generated by configure. - next if -f "$file.in"; - - # Known binaries. - next if $file =~ m%/(named|lwresd|rndc)$%; - next if $file =~ m%/(dig|host|nslookup|nsupdate)$%; - next if $file =~ m%/dnsssec-(sign(key|zone)|keygen|makekeyset)$%; - next if $file =~ m%/t_[^.]*$%; - - # A little more expensive test for remaining files to ignore. - next if -B $file; + print "$file\n"; unless (open(FILEIN, "< $file")) { warn "$0: open < $file: $!, skipping\n"; next; } - + undef $/; # Slurp whole file. $_ = ; $/ = "\n"; # Back to line-at-a-time for .