Commit dd3de226 authored by remy's avatar remy
Browse files

adding a compare2init option, in order to check differences with an init workdir

parent f71c8271
......@@ -47,7 +47,8 @@ DIFF=`command -v diff`
usage="$0 [compare|init|check|clean|--help]\n\n
\tcompare: display more informations on differences\n
\tcompare: display more informations on differences since previous run\n
\tcompare2init: display more informations on differences since first run\n
\tinit: build the sha256sum.txt.orig file and a status.log file (see bellow)\n
\tcheck: run a basic check - get http answer and compare index checksums to the first run\n
\tclean: remove the workdir\n
......@@ -183,7 +184,12 @@ if [[ "$1" == "compare" ]]; then
for file in `ls *.html`; do
mv $file $file.orig
done
ext2compare="orig"
COMPARE=true
elif [[ "$1" == "compare2init" ]]; then
cd ${WORKDIR}
COMPARE=true
ext2compare="init"
elif [[ "$1" == "init" ]]; then
rm -rf ${WORKDIR}
FIRST=true
......@@ -232,14 +238,14 @@ if [ -z ${FIRST} ]; then
websites_modified=`awk '/index.html/ {print $3}' modified_websites.txt|uniq`
for website_modified in $websites_modified
do
orig_file=`echo "${website_modified}.orig"`
orig_file=`echo "${website_modified}.${ext2compare}"`
echo ""
echo "#################################################################"
echo "Checking if there is any .orig file to compare with new result..."
echo "## Checking if there is any file to compare with new result... ##"
echo "#################################################################"
echo ""
if [ -f $website_modified ] && [ -f $orig_file ]; then
echo $DIFF $orig_file $website_modified
echo $DIFF -Ebw workdir/$orig_file workdir/$website_modified
echo ""
$DIFF $orig_file $website_modified
fi
......@@ -266,6 +272,9 @@ if [ -z ${FIRST} ]; then
echo "}" >> checksums.json
else
$SHA256SUM *.html > sha256sum.txt.orig
for file in `ls *.html`; do
cp $file $file.init
done
fi
total=`cat status.log|wc -l`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment