File: dds2tar-test.sh

package info (click to toggle)
dds2tar 2.4.21-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 352 kB
  • ctags: 167
  • sloc: ansic: 1,822; makefile: 182; sh: 158; csh: 50
file content (126 lines) | stat: -rwxr-xr-x 2,915 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/sh
make

if test q$TAPE = q ; then export TAPE=/dev/nst0 ; fi
case $TAPE in
/dev/nst0|/dev/st0) V=`scsi_vendor tape 1` ;;
/dev/nst1|/dev/st1) V=`scsi_vendor tape 2` ;;
esac

echo Tape vendor is $V
echo =======================

case $V in
HP) B=32 ;;
*) B=32 ;;
esac

echo $B

echo 'dds2tar-test >' make
make

echo ' '
echo 'dds2tar-test >' 'make of?'
if test ! -x ./dds2tar ; then exit 1 ; fi

echo ' '
echo 'dds2tar-test >' creating soft links
ln -sf ./dds2tar ./dds2index
ln -sf ./dds2tar ./mt-dds

echo ' '
echo 'dds2tar-test >' creating soft and hard links
ln -s dds2tar dds2tar-test-tape-link-soft
ln dds2tar dds2tar-test-tape-link-hard

echo ' '
echo 'dds2tar-test >' tar c .
tar c .

echo ' '
echo 'dds2tar-test >' tar -c --label dds2tar -b $B ... .
tar --label dds2tar --record-file index-of-tar -R -v -c -b $B .

I=`grep 'number of the file' index-of-tar | cut -c 38-43`
if test q"$I" = q ; then I=1 ; fi 
if test $I = 0 ; then exit 1 ; fi
I=`expr $I - 1`
echo file number of the archive written is $I
if test "$I" = "" ; then exit 1 ; fi

echo ' '
echo 'dds2tar-test >' tar -c . ...
tar --record-file index-of-tar-v -v -R -v -c -b $B .

echo ' '
echo 'dds2tar-test >' mt rewind \; mt fsf $I
mt rewind ; mt fsf $I

echo ' '
echo 'dds2tar-test >' mt-dds tell
./mt-dds tell

echo ' '
echo 'dds2tar-test >' mt-dds label
./mt-dds label

echo ' '
echo 'dds2tar-test >' mt-dds
./mt-dds

echo ' '
echo 'dds2tar-test >' dds2index
./dds2index -t index-of-dds2index

echo ' '
echo 'dds2tar-test >' find '*tape*' using index-of-tar
./dds2tar -t index-of-tar '*tape*' | tar fvt -

echo ' '
echo 'dds2tar-test >' find '*tape*' using index-of-tar-v
./dds2tar -t index-of-tar-v '*tape*' | tar fvt -

echo ' '
echo 'dds2tar-test >' find '*tape*' using index-of-dds2index
./dds2tar -t index-of-dds2index '*tape*' | tar vft -

echo ' '
echo 'dds2tar-test >' dds2tar -t index-of-tar --body Changes '|wc -c'
./dds2tar -t index-of-tar --body Changes | wc -c
ls -l Changes

if test $I -eq 0 ; then
	echo 'dds2tar-test >' mt rewind
	mt rewind
else
	echo 'dds2tar-test >' mt rewind \; mt fsf $I
	mt rewind ; mt fsf $I
fi

echo ' '
echo mt-dds
mt-dds

echo ' '
echo 'dds2tar-test > mt-dds tell >'index-of-tar-t
mt-dds tell >index-of-tar-t
echo 'dds2tar-test > tar tR >>' index-of-tar-t
tar tR >> index-of-tar-t
echo 'dds2tar-test >' grep -v "'loc        '" '< index-of-tar-t > index-of-tar-t2'
grep -v 'loc        ' < index-of-tar-t > index-of-tar-t2
echo 'dds2tar-test >' find '*tape*' using index-of-tar-t2 and mt-dds
echo 'dda2tar-test >' ./dds2tar '`mt-dds`' -t index-of-tar-t2 '*tape*' | tar bvft 1 -
./dds2tar `mt-dds` -t index-of-tar-t2 '*tape*' | tar bvft 1 -

if test $I -eq 0 ; then
	echo 'dds2tar-test >' mt rewind
	mt rewind
else
	echo 'dds2tar-test >' mt rewind \; mt fsf $I
	mt rewind ; mt fsf $I
fi
echo 'dds2tar-test >' removing links
/bin/rm dds2tar-test-tape-link-soft
/bin/rm dds2tar-test-tape-link-hard