1# $Id$ 2 3do_cksum() { 4 while read CRC SIZE NAME; do 5 CRC2=0; SIZE2=0; NAME2="" 6 if cksum "$NAME" | ( 7 read CRC2 SIZE2 NAME2 8 9 if [ "$CRC" != "$CRC2" ] ; then 10 if [ 'quiet' != "$1" ] ; then 11 echo "$0: CRC didn't match for $NAME ($CRC != $CRC2)" 12 fi 13 return 0; 14 fi 15 16 if [ "$SIZE" != "$SIZE2" ]; then 17 echo "$0: SIZE didn't match for $NAME ($SIZE != $SIZE2)" 18 return 0; 19 fi 20 21 return 1 22 ); 23 then 24 return 1; 25 fi 26 done 27 28 return 0; 29} 30 31have_cksum() { 32 if cksum /dev/null > /dev/null 2>&1; then 33 : 34 else 35 return 1; 36 fi 37 38 return 0; 39} 40 41# Echo result 42check_result() { 43 RC=$1 44 shift 45 msg=$* 46 if test $RC -ne 0 ; then 47 if test $RC -ne 77 ; then 48 echo "$0: $msg failed." 49 exit $RC 50 else 51 echo "$0: $msg skipped." 52 fi 53 else 54 echo "$0: $msg ok." 55 fi 56} 57 58# Do a file compare of $1 with $2 for program $3 59cmp_files() { 60 outfile=$1 61 rightfile=$2 62 prog=$3 63 if test "@DIFF@" != no ; then 64 if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then 65 rm -f $outfile 66 return 0 67 else 68 return 3 69 fi 70 else 71 echo "$0: No diff(1) or cmp(1) found - cannot test $prog" 72 rm -f $outfile 73 return 77 74 fi 75} 76 77#;;; Local Variables: *** 78#;;; mode:shell-script *** 79#;;; eval: (sh-set-shell "bash") *** 80#;;; End: *** 81