]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Updates for running on squid-cache.org
authorAmos Jeffries <amosjeffries@squid-cache.org>
Fri, 10 Oct 2008 05:02:56 +0000 (23:02 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Fri, 10 Oct 2008 05:02:56 +0000 (23:02 -0600)
scripts/formater.pl
scripts/srcformat.sh

index af929fc0ad97d882e3da697100b9b1675783f6d6..1f8478ea77554c44b3be71daba89fea4daea8d7f 100755 (executable)
@@ -25,7 +25,7 @@ use IPC::Open2;
 #
 # 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";
index dbfa603545158b2a8f34791bebabfee83a835587..ce9fd9b9b198055d88fc25e387b93fa28cf9a1be 100755 (executable)
@@ -1,4 +1,4 @@
-#!/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
@@ -7,9 +7,16 @@
 # 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" \
@@ -20,10 +27,10 @@ for FILENAME in `ls -1`; do
        ${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