2 # Demonstrate using a combination of --reference and --date to
3 # set the time of a file back by an arbitrary amount.
5 if test "$VERBOSE" = yes; then
10 .
$srcdir/..
/envvar-check
13 t0
=`echo "$0"|sed 's,.*/,,'`.tmp
; tmp
=$t0/$$
14 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
15 trap '(exit $?); exit $?' 1 2 13 15
18 mkdir
-p $tmp || framework_failure
=1
19 cd $tmp || framework_failure
=1
20 TZ
=UTC0
touch --date='2004-01-16 12:00 +0000' f || framework_failure
=1
22 if test $framework_failure = 1; then
23 echo "$0: failure in testing framework" 1>&2
29 # Set times back by 5 days.
30 touch --ref f
--date='-5 days' f || fail
=1
32 TZ
=UTC0
ls -og --time-style=+%Y-
%m-
%d f
> out
.1 || fail
33 sed 's/ f$//;s/.* //' out
.1 > out
35 cat <<\EOF
> exp || fail
=1
40 test $fail = 1 && diff out exp
2> /dev
/null
42 (exit $fail); exit $fail