#!/usr/bin/env perl # $Id$ # Public domain. Originally written 2008, Karl Berry. # Compare two files for being "essentially" equivalent; see help msg below. # # Used in the place and tlpkg-ctan-check scripts in TeX Live. exit (&main ()); sub main { if (@ARGV != 2) { warn <) { s/\r\n?/\n/g; # ignoring blank lines causes problems because of the eol # conversions, e.g., in cbaccent.mf and jpsj/template.tex. sigh. next if /^\s*%%\s*$/; # ignore %% lines, see above. #warn "line is |$_|"; $ret .= $_; } close ($FILE) || warn "close($fname) failed: $!"; # if the file did not have a trailing newline, add one for purposes of # comparison, since it can slip in if we edit it, etc. $ret .= "\n" if substr ($ret, -1) ne "\n"; return $ret; }