re-establish kernel assert()s.
[minix.git] / commands / scripts / packit.sh
blob9c27d8f0a6059354f2874d9d2259945f941563c5
1 #!/bin/sh
3 PI=.postinstall
4 TMP=/usr/tmp
5 PATH=/bin:/usr/bin:/usr/local/bin
7 if [ "$#" -ne 1 ]
8 then
9 echo "Usage: $0 <package file>"
10 exit 1
13 dir=`pwd`
14 if [ "$1" = "-" ]
15 then f=""
16 else case "$1" in
17 /*) f="$1" ;;
18 *) f="$dir/$1" ;;
19 esac
22 cd $TMP
23 rm -f $PI
25 if [ -f $PI ]
26 then echo "$PI is in $TMP, please remove it first."
27 exit 1
30 if [ ! -f $f ]
31 then echo "Couldn't find package $f."
32 exit 1
35 # can we execute bunzip2?
36 if bunzip2 --help 2>&1 | grep usage >/dev/null
37 then BUNZIP2=bunzip2
38 else BUNZIP2=smallbunzip2
41 cat $f | $BUNZIP2 | pax -r -p e
42 if [ -f $PI ]
43 then
44 sh -e $PI
45 rm -f $PI
48 for d in /usr/man /usr/local/man /usr/gnu/man /usr/X11R6/man
49 do if [ -d "$d" ]
50 then makewhatis $d
52 done