mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-05 00:55:24 +00:00
tabify CHANGES/CHANGES.SE/EXCLUDED
This commit is contained in:
@@ -141,6 +141,38 @@ foreach $file (keys %file_types) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($file eq "./CHANGES" || $file eq "./EXCLUDED" ||
|
||||
$file eq "./CHANGES.SE")
|
||||
{
|
||||
open(SOURCE, "<$file") || die "can't open $file: $!";
|
||||
my $body = "";
|
||||
while (<SOURCE>) {
|
||||
# Process leading white space.
|
||||
# Remove 1-7 spaces followed by a tab into a single
|
||||
# tab if at start of line or proceeded by tabs.
|
||||
s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
|
||||
s/^(\s{0,3}\d*\.)\s(\[\w{1,5}\])\s+(\S+)/\1\t\2\t\t\3/;
|
||||
s/^(\s{0,3}\d*\.)\s(\[\w{6,}\])\s+(\S+)/\1\t\2\t\3/;
|
||||
# Convert 8 spaces into tabs if at start of line
|
||||
# or preceeded by tabs.
|
||||
s/^(\t*) /$1\t/ while (/^\t* /);
|
||||
# Remove trailing white space.
|
||||
s/[ \t]*$//;
|
||||
$body = "$body$_";
|
||||
}
|
||||
$_ = $body;
|
||||
open(TARGET, ">$file.new") || die "can't open $file.new: $!";
|
||||
print TARGET $_;
|
||||
close(TARGET);
|
||||
close(SOURCE);
|
||||
if (system("cmp -s $file.new $file") == 0) {
|
||||
unlink("$file.new");
|
||||
} else {
|
||||
rename("$file.new", "$file")
|
||||
or die "rename($file.new, $file): $!";
|
||||
}
|
||||
}
|
||||
|
||||
next if $type eq "X" or $type eq "BAT";
|
||||
|
||||
$before_copyright = "";
|
||||
|
Reference in New Issue
Block a user