This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
MahiroOS-jhalfs/extras/do_ica_work

50 lines
1.2 KiB
Text
Raw Normal View History

2006-04-08 19:01:40 +02:00
#!/bin/bash
# $Id$
2006-04-09 19:29:45 +02:00
# Acknowledgment:
# The following code is a modified version of an original work written by
# Greg Schafer for the "DIY Linux" project and is included here with his
# permission.
# ref: http://www.diy-linux.org
#
2006-04-08 19:01:40 +02:00
set -e
2006-04-09 20:04:26 +02:00
: <<inline_doc
desc: creates the ICA report
usage: do_ica_work $PREV $ITERATION $ICALOGDIR $DEST_ICA
input vars: $1 previous iteration
$2 current iteration
$3 ICA log dir
$4 directory where ICA iterations are stored
externals: --
modifies: --
returns: --
on error:
on success:
inline_doc
2006-04-10 21:12:24 +02:00
RAWDIFF=/tmp/rawdiff.$$
REPORT="${3}/REPORT.${1}V${2}"
2006-04-09 19:29:45 +02:00
cd $4
echo -e "Diffing ${1} and ${2}... " > $REPORT
diff -ur ${1} ${2} > $RAWDIFF || :
echo -e "The list of binary files that differ:\n" > $REPORT
grep "iles.*differ$" $RAWDIFF >> $REPORT
echo -e "The list of files that exist \"only in\" 1 of the directories:\n" >> $REPORT
if grep "^Only in" $RAWDIFF >/dev/null 2>&1; then
grep "^Only in" $RAWDIFF >> $REPORT
else
echo NONE >> $REPORT
fi
2006-04-08 19:01:40 +02:00
2006-04-09 19:29:45 +02:00
grep -v "iles.*differ$" $RAWDIFF | \
grep -v "^Only in" > ${ICA_DIR}/${1}V${2}.ASCII.DIFF
2006-04-08 19:01:40 +02:00
2006-04-09 19:29:45 +02:00
rm -f $RAWDIFF