diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-05 21:23:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-05 21:23:41 +0000 |
commit | 8521b01ecac612b40d10ae5952136d19ca8272a9 (patch) | |
tree | 2b374360b679f541bfdf2a60ad9d8e2c91b6af54 /Master | |
parent | 4841514f93738ae48601c6e37f8604dccd76dea4 (diff) |
(read_file): ignore blank lines.
git-svn-id: svn://tug.org/texlive/trunk@60431 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-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 .= $_; |