summaryrefslogtreecommitdiff
path: root/regress/bin/pax/t5.sh
blob: 48ec7edd2b8e3ea3432aa25d162bba83b3e330fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# $OpenBSD: t5.sh,v 1.1 2006/01/25 17:42:08 markus Exp $
# append without a file list should not corrupt a tar file
#
OBJ=$2
cd ${OBJ}
fail () {
	rm -f a b foo.tar
	echo "$*"
	exit 1
}
echo a > a
echo b > b
echo a  | pax -w -f foo.tar
tar tf foo.tar | grep -q a || fail missing file a
# append without a file list
echo -n | pax -w -a -f foo.tar
tar tf foo.tar > /dev/null || fail not a tar file
# again
echo    | pax -w -a -f foo.tar
tar tf foo.tar > /dev/null || fail not a tar file
# append file
echo b  | pax -w -a -f foo.tar
for i in a b; do
	tar tf foo.tar | grep -q $i || fail missing file $i
done
rm -f a b foo.tar