From ae9ec747ab13e48ba02b4cc23893f0acdc430505 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 1 Jul 2009 05:15:09 +0000 Subject: add tlcmp from tlpkg/bin/cmp_textfiles to TLUtils, use it instead of the call to external diff in tlmgr check runfiles, do the runfile test if tlmgr check all is done git-svn-id: svn://tug.org/texlive/trunk@14045 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 9b436d00175..34e9788bb88 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -48,6 +48,7 @@ C -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::removed_dirs(@files); TeXLive::TLUtils::download_file($path, $destination [, $progs ]); TeXLive::TLUtils::setup_programs($bindir, $platform); + TeXLive::TLUtils::tlcmp($file, $file); =head2 Installer Functions @@ -123,6 +124,7 @@ BEGIN { &xsystem &run_cmd &announce_execute_actions + &tlcmp ); @EXPORT = qw(setup_programs download_file process_logging_options tldie tlwarn info log debug ddebug dddebug debug_hash @@ -1723,6 +1725,50 @@ sub untar { } +=item C + +Compare two files considering CR, LF, and CRLF as equivalent. +Returns 1 if different, 0 if the same. + +=cut + +sub tlcmp +{ + my ($filea, $fileb) = @_; + if (!defined($fileb)) { + die <) { + s/\r\n?/\n/g; + #warn "line is |$_|"; + $ret .= $_; + } + close (FILE) || warn "close($fname) failed: $!"; + + return $ret; +} + =item C -- cgit v1.2.3