diff options
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-x | Master/tlpkg/bin/cmp-textfiles | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Master/tlpkg/bin/cmp-textfiles b/Master/tlpkg/bin/cmp-textfiles index 053020c2264..133be7bd0bd 100755 --- a/Master/tlpkg/bin/cmp-textfiles +++ b/Master/tlpkg/bin/cmp-textfiles @@ -1,11 +1,9 @@ #!/usr/bin/env perl # $Id$ # Public domain. Originally written 2008, Karl Berry. -# Compare two files considering CR, LF, and CRLF as equivalent, -# ignoring blank lines, -# and ignoring %% lines (see below). +# Compare two files for being "essentially" equivalent; see help msg below. # -# Used in place and tlpkg-ctan-check in TeX Live. +# Used in the place and tlpkg-ctan-check scripts in TeX Live. exit (&main ()); @@ -13,7 +11,7 @@ sub main { if (@ARGV != 2) { warn <<END_USAGE; Usage: $0 FILE1 FILE2. -Compare as text files, ignoring line endings and %% lines. +Compare as text files, ignoring line endings, blank lines, and %% lines. Exit status is zero if the same, 1 if different, something else if trouble. END_USAGE exit $ARGV[0] eq "--help" ? 0 : 2; @@ -42,6 +40,7 @@ sub read_file { open (my $FILE, $fname) || die "open($fname) failed: $!"; while (<$FILE>) { s/\r\n?/\n/g; + next if /^\*$/; # ignore blank lines. next if /^\s*%%\s*$/; # ignore %% lines, see above. #warn "line is |$_|"; $ret .= $_; |