]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.sbin/mtree/test/test02.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.sbin / mtree / test / test02.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2003 Dan Nelson
4 # All rights reserved.
5 #
6 # Please see src/share/examples/etc/bsd-style-copyright.
7 #
8 # $FreeBSD$
9 #
10
11 set -e
12
13 TMP=/tmp/mtree.$$
14
15 rm -rf ${TMP}
16 mkdir -p ${TMP} ${TMP}/mr ${TMP}/mt
17
18 touch -t 199901020304 ${TMP}/mr/oldfile
19 touch ${TMP}/mt/oldfile
20
21 mtree -c -p ${TMP}/mr > ${TMP}/_ 
22
23 mtree -U -r -p ${TMP}/mt < ${TMP}/_ > /dev/null
24
25 x=x`(cd ${TMP}/mr ; ls -l 2>&1) || true`
26 y=x`(cd ${TMP}/mt ; ls -l 2>&1) || true`
27
28 if [ "$x" != "$y" ] ; then
29         echo "ERROR Update of mtime failed" 1>&2
30         rm -rf ${TMP}
31         exit 1
32 fi
33
34 rm -rf ${TMP}
35 exit 0
36