h-c: infinite context for file MD5 sum comparison

Since C&CS checkers are often interested in the list of files that
have stayed the same between a firmware release and the result of
compiling the C&CS for that firmware (ie. to see if there are binaries
which have not changed, which is unlikely because each compiler
configuration outputs slightly different binaries), add "infinite"
lines of context in the diff command for the MD5 checksum comparison.
This will include all files that have not changed (in addition to the
files that have changed).

I didn't immediately see a flag for infinite lines of context in the
diff manpage so I'm using a big number for now (2,000,000,000).
This commit is contained in:
Denver Gingerich 2011-05-20 11:16:11 -04:00
parent 349f4eee34
commit 31e2c78e8c

View file

@ -198,8 +198,11 @@ my $comparedFiles2sha1 = MD5SumFiles($comparedDir, \@c, $comparedTempFile);
system("/bin/echo >> $diffOutputFile 2>&1");
system("/bin/echo 'File contents comparisons (MD5):' >> $diffOutputFile 2>&1");
# for C&CS checking, the list of files that are the same (esp. binary) is useful
# so use infinite number of lines of context to show these files
# TODO: replace -U[big_number] with proper infinite context flag (ossguy)
system(
"/usr/bin/diff -u $origTempFile $comparedTempFile >> $diffOutputFile 2>&1");
"/usr/bin/diff -U2000000000 $origTempFile $comparedTempFile >> $diffOutputFile 2>&1");
$diffExitCode = $?;
unlink($origTempFile, $comparedTempFile);