diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2000-07-02 00:10:50 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2000-07-02 00:10:50 (GMT) |
commit | d4c6268b826be3722835d49be9fd904a2a765edb (patch) | |
tree | 5bc2b7673f26dd7f6d0d837f3fe8fc5e3c71ff59 /bin/snapshot | |
parent | 5744b53675d76d2713655a4c4bb9742997a03698 (diff) | |
download | hdf5-d4c6268b826be3722835d49be9fd904a2a765edb.zip hdf5-d4c6268b826be3722835d49be9fd904a2a765edb.tar.gz hdf5-d4c6268b826be3722835d49be9fd904a2a765edb.tar.bz2 |
[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
Diffstat (limited to 'bin/snapshot')
-rwxr-xr-x | bin/snapshot | 11 |
1 files 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 |