1 # tpkg that only exes the files.
3 if test "$1" = "-a"; then
9 if test "$1" = "clean"; then
10 echo "rm -f result.* .done* .tpkg.var.master .tpkg.var.test"
11 rm -f result.
* .
done* .tpkg.var.master .tpkg.var.
test
14 if test "$1" = "fake"; then
15 echo "minitpkg fake $2"
16 echo "fake" > .
done-`basename $2 .tpkg`
19 if test "$1" = "report" || test "$2" = "report"; then
20 echo "Minitpkg Report"
21 for result
in *.tpkg
; do
22 name
=`basename $result .tpkg`
23 if test -f ".done-$name"; then
24 if test "$1" != "-q"; then
25 echo "** PASSED ** : $name"
28 if test -f "result.$name"; then
29 echo "!! FAILED !! : $name"
31 echo ">> SKIPPED<< : $name"
38 if test "$1" != 'exe'; then
40 echo "mini tpkg. Reduced functionality for old shells."
41 echo " tpkg exe <file>"
42 echo " tpkg fake <file>"
44 echo " tpkg [-q] report"
49 # do not execute if the disk is too full
51 # This check is not portable (to Solaris 10).
52 #avail=`df . | tail -1 | awk '{print $4}'`
53 #if test "$avail" -lt "$DISKLIMIT"; then
54 #echo "minitpkg: The disk is too full! Only $avail."
58 name
=`basename $1 .tpkg`
63 if test -x "`which bash`"; then
70 if test -f .
done-$name; then
71 echo "minitpkg .done-$name exists. skip test."
76 echo "minitpkg extract $1 to $dir"
78 gzip -cd $name.tpkg
| (cd $dir; tar xf
-)
83 echo "minitpkg exe $name" > $result
84 grep "Description:" $name.dsc
>> $result 2>&1
85 echo "DateRunStart: "`date "+%s" 2>/dev/null` >> $result
86 if test -f $name.pre
; then
87 echo "minitpkg exe $name.pre"
88 echo "minitpkg exe $name.pre" >> $result
89 $shell $name.pre
$args >> $result
90 if test $?
-ne 0; then
91 echo "Warning: $name.pre did not exit successfully"
94 if test -f $name.
test; then
95 echo "minitpkg exe $name.test"
96 echo "minitpkg exe $name.test" >> $result
97 $shell $name.
test $args >>$result 2>&1
98 if test $?
-ne 0; then
99 echo "$name: FAILED" >> $result
103 echo "$name: PASSED" >> $result
104 echo "$name: PASSED" > ..
/.
done-$name
109 if test -f $name.post
; then
110 echo "minitpkg exe $name.post"
111 echo "minitpkg exe $name.post" >> $result
112 $shell $name.post
$args >> $result
113 if test $?
-ne 0; then
114 echo "Warning: $name.post did not exit successfully"
117 echo "DateRunEnd: "`date "+%s" 2>/dev/null` >> $result
122 # compat for windows where deletion may not succeed initially (files locked
123 # by processes that still have to exit).
124 if test $?
-eq 1; then
125 echo "minitpkg waiting for processes to terminate"
126 sleep 2 # some time to exit, and try again