summaryrefslogtreecommitdiffstats
path: root/bin/newer
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-08-30 23:42:39 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-08-30 23:42:39 (GMT)
commit66af6dce17787f70e7bded57fdc63b1006ade754 (patch)
treeeb9ecc21bd4c265448324f9e192efac02fd841d8 /bin/newer
parent70ddbda208079d6597e453b510f9bfa9320cf0bf (diff)
downloadhdf5-66af6dce17787f70e7bded57fdc63b1006ade754.zip
hdf5-66af6dce17787f70e7bded57fdc63b1006ade754.tar.gz
hdf5-66af6dce17787f70e7bded57fdc63b1006ade754.tar.bz2
[svn-r11319] Purpose:
Bug fixes Description: This checkin fixes an occasional error on kelgia on sol during distclean. It also causes test scripts to depend properly on the programs they're supposed to be testing. Solution: The kelgia bug was due to some files being cleaned by automake and manually. Removed the manual cleaning in src/Makefile.am. Test script dependencies now need to be specified manually, since the makefile can't guess what they test from their name. Currently all test scripts in a given directory have a single list of dependencies--this was easy and seems to be sufficient. These dependencies are listed in the SCRIPT_DEPEND variable in the Makefile.am. Platforms tested: heping, mir, modi4, sol Misc. update:
Diffstat (limited to 'bin/newer')
-rwxr-xr-xbin/newer35
1 files changed, 25 insertions, 10 deletions
diff --git a/bin/newer b/bin/newer
index ed2743b..d2043be 100755
--- a/bin/newer
+++ b/bin/newer
@@ -12,18 +12,33 @@
## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
##
-# Compare the modification of two files. If file1 is newer than file2,
-# return true (0). Otherwise return false (1). If file1 or file2 does
-# not exist or is not a file, return false (1).
+# Compare the modification time of file argument 1 against other file arguments.
+# Return true (0) if argument 1 is newer than all others, otherwise return
+# false (1). If any of the argument is not a file, return false (1).
#
# Programmer: Albert Cheng
# Created Date: 2005/07/06
+# Modification:
+# Albert Cheng 2005/8/30
+# Changed from two arguments to mulitple arguments.
-if test $# -eq 2; then
- if test -f $1 -a -f $2; then
- if test X != X`find $1 -newer $2 -print`; then
- exit 0
- fi
- fi
+if test $# -lt 2; then
+ exit 1
+fi
+if test ! -f $1; then
+ exit 1
fi
-exit 1
+f1=$1
+shift
+
+for f in $*; do
+ if ! test -f $f; then
+ exit 1
+ fi
+ if test X = X`find $f1 -newer $f -print`; then
+ exit 1
+ fi
+done
+
+# passed all tests. Must be a file newer than all others.
+exit 0