#
# NP: The Squid code requires astyle version 1.22 or later
#
-$ASTYLE_BIN="/usr/bin/astyle";
+$ASTYLE_BIN="/usr/local/bin/astyle";
#$ASTYLE_BIN="/usr/local/src/astyle-1.22/bin/astyle";
$ASTYLE_ARGS ="--mode=c -s4 -O -l";
-#!/bin/bash
+#!/usr/local/bin/bash
#
# A checker to recursively reformat all source files: .h .c .cc .cci
# using a custom astyle formatter and to use MD5 to validate that
# If code alteration takes place the process is halted for manual intervention.
#
+# On squid-cache.org we have to use the python scripted md5sum
+HOST=`hostname`
+if test "$HOST" = "squid-cache.org" ; then
+ MD5="python /usr/local/share/python2.4/Tools/scripts/md5sum.py -"
+else
+ MD5="md5sum"
+fi
+
ROOT="$1"
PWD=`pwd`
-
for FILENAME in `ls -1`; do
if test "${FILENAME: -2:2}" = ".h" \
${ROOT}/scripts/formater.pl ${FILENAME}
if test -e $FILENAME -a -e "$FILENAME.astylebak"; then
- md51=`cat $FILENAME| tr -d "\n \t\r" | md5sum|sed 's/ -//'`;
- md52=`cat $FILENAME.astylebak| tr -d "\n \t\r" | md5sum|sed 's/ -//'`;
+ md51=`cat $FILENAME| tr -d "\n \t\r" | $MD5 | sed 's/ -//'`;
+ md52=`cat $FILENAME.astylebak| tr -d "\n \t\r" | $MD5 | sed 's/ -//'`;
- if test $md51 != $md52; then
+ if test "$md51" != "$md52" ; then
echo "File $PWD/$FILENAME not converted well";
exit 1;
fi