190483c011
specification, but not in the file hierarchy. PR: bin/99531 Submitted by: skv Obtained from: NetBSD, originally from Ed Symanzik Regress. test: test/test05.sh MFC after: 1 month
26 lines
474 B
Bash
26 lines
474 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# Test for 'optional' keyword.
|
|
#
|
|
|
|
TMP=`mktemp -d /tmp/mtree.XXXXXX`
|
|
mkdir -p ${TMP}/mr ${TMP}/mr/optional-dir ${TMP}/mr/some-dir
|
|
touch ${TMP}/mr/optional-file ${TMP}/mr/some-file
|
|
|
|
mtree -c -p ${TMP}/mr > ${TMP}/_
|
|
rm -rf ${TMP}/mr/optional-file ${TMP}/mr/optional-dir
|
|
mtree -p ${TMP}/mr -K optional < ${TMP}/_ > /dev/null
|
|
|
|
res=$?
|
|
|
|
if [ $res -ne 0 ] ; then
|
|
echo "ERROR 'optional' keyword failed" 1>&2
|
|
rm -rf ${TMP}
|
|
exit 1
|
|
fi
|
|
|
|
rm -rf ${TMP}
|
|
exit 0
|