diff --git a/hierarchy-comparison b/hierarchy-comparison index f921df3..dc35e3f 100755 --- a/hierarchy-comparison +++ b/hierarchy-comparison @@ -2,6 +2,7 @@ # hierarchy-comparison -*- Perl -*- # Possible bug: only -type f and -type d are checked # Copyright (C) 2001, 2002, 2003, 2004, 2008 Bradley M. Kuhn +# Copyright (C) 2011 Denver Gingerich # # This software's license gives you freedom; you can copy, convey, # propogate, redistribute and/or modify this program under the terms of @@ -122,6 +123,8 @@ my(@comparedNonRegular) = FindAndSortOutput("NON-REGULAR", $comparedDir, $comparedTempFile, $ignoreRegex, "^/?($origDir|$comparedDir)/?"); +# TODO: use the right Perl mechanism instead of /bin/echo (ossguy) +system("/bin/echo Directory comparison: >> $diffOutputFile 2>&1"); system( "/usr/bin/diff -u $origTempFile $comparedTempFile >> $diffOutputFile 2>&1"); @@ -147,6 +150,10 @@ my(@orgFiles) = FindAndSortOutput("FILES", $origDir, $origTempFile, my(@comparedFiles) = FindAndSortOutput("FILES", $comparedDir, $comparedTempFile, $ignoreRegex, "^/?($origDir|$comparedDir)/?"); +# TODO: use the right Perl mechanism instead of /bin/echo (ossguy) +system("/bin/echo >> $diffOutputFile 2>&1"); +system("/bin/echo File hierarchy comparison: >> $diffOutputFile 2>&1"); + system( "/usr/bin/diff -u $origTempFile $comparedTempFile >> $diffOutputFile 2>&1"); @@ -187,12 +194,20 @@ my(@o, @c); my $origFiles2sha1 = MD5SumFiles($origDir, \@o, $origTempFile); my $comparedFiles2sha1 = MD5SumFiles($comparedDir, \@c, $comparedTempFile); +# TODO: use the right Perl mechanism instead of /bin/echo (ossguy) +system("/bin/echo >> $diffOutputFile 2>&1"); +system("/bin/echo 'File contents comparisons (MD5):' >> $diffOutputFile 2>&1"); + system( "/usr/bin/diff -u $origTempFile $comparedTempFile >> $diffOutputFile 2>&1"); $diffExitCode = $?; unlink($origTempFile, $comparedTempFile); +# TODO: use the right Perl mechanism instead of /bin/echo (ossguy) +system("/bin/echo >> $diffOutputFile 2>&1"); +system("/bin/echo 'File contents comparisons (diff):' >> $diffOutputFile 2>&1"); + if ($DO_DIFF) { foreach my $file (keys %final) { if ($origFiles2sha1->{$file} ne $comparedFiles2sha1->{$file}) {