2006-02-16 16:43:37 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PI=.postinstall
|
|
|
|
TMP=/usr/tmp
|
2006-02-17 14:10:37 +01:00
|
|
|
PATH=/bin:/usr/bin:/usr/local/bin
|
2006-02-16 16:43:37 +01:00
|
|
|
|
|
|
|
if [ "$#" -ne 1 ]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 <package file>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
dir=`pwd`
|
|
|
|
if [ "$1" = "-" ]
|
|
|
|
then f=""
|
2006-03-17 16:32:14 +01:00
|
|
|
else case "$1" in
|
|
|
|
/*) f="$1" ;;
|
|
|
|
*) f="$dir/$1" ;;
|
|
|
|
esac
|
2006-02-16 16:43:37 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd $TMP
|
|
|
|
rm -f $PI
|
|
|
|
|
|
|
|
if [ -f $PI ]
|
|
|
|
then echo "$PI is in $TMP, please remove it first."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f $f ]
|
|
|
|
then echo "Couldn't find package $f."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-04-04 16:52:22 +02:00
|
|
|
# can we execute bunzip2?
|
|
|
|
if bunzip2 --help 2>&1 | grep usage >/dev/null
|
|
|
|
then BUNZIP2=bunzip2
|
|
|
|
else BUNZIP2=smallbunzip2
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat $f | $BUNZIP2 | pax -r -p e
|
2006-02-16 16:43:37 +01:00
|
|
|
if [ -f $PI ]
|
|
|
|
then
|
|
|
|
sh -e $PI
|
|
|
|
rm -f $PI
|
|
|
|
fi
|
|
|
|
|
2006-04-04 18:15:00 +02:00
|
|
|
for d in /usr/man /usr/local/man /usr/gnu/man /usr/X11R6/man
|
|
|
|
do if [ -d "$d" ]
|
|
|
|
then makewhatis $d
|
|
|
|
fi
|
|
|
|
done
|