From d4c6268b826be3722835d49be9fd904a2a765edb Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 1 Jul 2000 19:10:50 -0500 Subject: [svn-r2424] snapshot needs a version of diff that supports the -I (ignore pattern) option. A system may have several versions of diff (e.g., vendor's and Gnu's). Added codes to try them all until finding one that supports it. If found, use it; else stick with plain "diff" and may waste time when there are no differences besides the ignorable patterns. Platforms tested: Solaris 2.7, Redhat 6.2 --- bin/snapshot | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/snapshot b/bin/snapshot index c4aad35..c5ec605 100755 --- a/bin/snapshot +++ b/bin/snapshot @@ -169,6 +169,13 @@ BASEDIR=${HOME}/snapshots-${H5VERSION} CURRENT=${BASEDIR}/current PREVIOUS=${BASEDIR}/previous +# Try finding a version of diff that supports the -I option too. +DIFF=diff +for d in `echo $PATH | sed -e 's/:/ /g'` ; do + test -x $d/diff && $d/diff -I XYZ /dev/null /dev/null > /dev/null 2>&1 && + DIFF=$d/diff && break +done + #============================= # Run CVS checkout #============================= @@ -215,10 +222,10 @@ if [ "$cmd" = "all" -o -n "$cmdtest" ]; then # Compare it with the previous version. Compare only files listed in # the MANIFEST plus the MANIFEST itself. if [ -d ${PREVIOUS} ]; then - if (diff -c ${PREVIOUS}/MANIFEST ${CURRENT}/MANIFEST); then + if (${DIFF} -c ${PREVIOUS}/MANIFEST ${CURRENT}/MANIFEST); then snapshot=no for src in `grep '^\.' ${CURRENT}/MANIFEST|expand|cut -f1 -d' '`; do - diff -I H5_VERS_RELEASE -I " released on " \ + ${DIFF} -I H5_VERS_RELEASE -I " released on " \ -I " currently under development" \ ${PREVIOUS}/$src ${CURRENT}/$src || \ snapshot=yes -- cgit v0.12