summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/cmp-textfiles
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-05 00:21:47 +0000
committerKarl Berry <karl@freefriends.org>2011-12-05 00:21:47 +0000
commit757da55142bf500fb11d5e9567bf1cec3b1dc18b (patch)
treec2a320e8bda1897211bafb05621fb26352c3add4 /Master/tlpkg/bin/cmp-textfiles
parentf154f5571f07ba54f345aaaeedf3a77130c0fd46 (diff)
(read_file): ignore %% lines, to avoid reporting
useless discrepancies against CTAN. git-svn-id: svn://tug.org/texlive/trunk@24757 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/cmp-textfiles')
-rwxr-xr-xMaster/tlpkg/bin/cmp-textfiles17
1 files changed, 12 insertions, 5 deletions
diff --git a/Master/tlpkg/bin/cmp-textfiles b/Master/tlpkg/bin/cmp-textfiles
index 88897294f4a..d0b3e30a152 100755
--- a/Master/tlpkg/bin/cmp-textfiles
+++ b/Master/tlpkg/bin/cmp-textfiles
@@ -1,13 +1,14 @@
#!/usr/bin/env perl
# $Id$
# Public domain. Originally written 2008, Karl Berry.
-# Compare two files considering CR, LF, and CRLF as equivalent.
+# Compare two files considering CR, LF, and CRLF as equivalent. ,
+# and ignoring %% lines (see below).
+#
# Used in place and tlpkg-ctan-check in TeX Live.
exit (&main ());
-sub main
-{
+sub main {
if (@ARGV != 2) {
warn <<END_USAGE;
Usage: $0 FILE1 FILE2.
@@ -27,8 +28,13 @@ END_USAGE
# Return contents of FNAME as a string, converting all of CR, LF, and
# CRLF to just LF.
#
-sub read_file
-{
+# Also, annoyingly, ignore lines consisting only of "%%". For an
+# unknown reason, derived files on CTAN often contain these lines, while
+# the same files regenerated by us do not. CTAN's general policy is not
+# to hold derived files, but there are too many exceptions and it is not
+# worth the time to continually contact CTAN and authors.
+#
+sub read_file {
my ($fname) = @_;
my $ret = "";
@@ -36,6 +42,7 @@ sub read_file
open (FILE, $fname) || die "open($fname) failed: $!";
while (<FILE>) {
s/\r\n?/\n/g;
+ next if /^\s*%%\s*$/; # ignore %% lines, see above.
#warn "line is |$_|";
$ret .= $_;
}