Debian Codegraph @

bin/newer

raw
1 #!/bin/sh
2 #
3 # Copyright by The HDF Group.
4 # Copyright by the Board of Trustees of the University of Illinois.
5 # All rights reserved.
6 #
7 # This file is part of HDF. The full HDF copyright notice, including
8 # terms governing use, modification, and redistribution, is contained in
9 # the COPYING file, which can be found at the root of the source code
10 # distribution tree, or in https://support.hdfgroup.org/ftp/HDF/releases/.
11 # If you do not have access to either file, you may request a copy from
12 # [email protected].
13 #
14 # Compare the modification time of file argument 1 against other file arguments.
15 # Return true (0) if argument 1 is newer than all others, otherwise return
16 # false (1). If any of the argument is not a file, return false (1).
17 #
18
19 if test $# -lt 2; then
20 exit 1
21 fi
22 if test ! -f $1; then
23 exit 1
24 fi
25 f1=$1
26 shift
27
28 for f in $*; do
29 if test ! -f $f; then
30 exit 1
31 fi
32 if test X = X`find $f1 -newer $f -print`; then
33 exit 1
34 fi
35 done
36
37 # passed all tests. Must be a file newer than all others.
38 exit 0