texlive[60431] Master/tlpkg/bin/cmp-textfiles: (read_file): ignore
commits+karl at tug.org
commits+karl at tug.org
Sun Sep 5 23:23:41 CEST 2021
Revision: 60431
http://tug.org/svn/texlive?view=revision&revision=60431
Author: karl
Date: 2021-09-05 23:23:41 +0200 (Sun, 05 Sep 2021)
Log Message:
-----------
(read_file): ignore blank lines.
Modified Paths:
--------------
trunk/Master/tlpkg/bin/cmp-textfiles
Modified: trunk/Master/tlpkg/bin/cmp-textfiles
===================================================================
--- trunk/Master/tlpkg/bin/cmp-textfiles 2021-09-05 20:49:05 UTC (rev 60430)
+++ trunk/Master/tlpkg/bin/cmp-textfiles 2021-09-05 21:23:41 UTC (rev 60431)
@@ -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 @@
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 @@
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 .= $_;
More information about the tex-live-commits
mailing list.