Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | PI=.postinstall
|
---|
4 | TMP=/usr/tmp
|
---|
5 | PATH=/bin:/usr/bin:/usr/local/bin
|
---|
6 |
|
---|
7 | if [ "$#" -ne 1 ]
|
---|
8 | then
|
---|
9 | echo "Usage: $0 <package file>"
|
---|
10 | exit 1
|
---|
11 | fi
|
---|
12 |
|
---|
13 | dir=`pwd`
|
---|
14 | if [ "$1" = "-" ]
|
---|
15 | then f=""
|
---|
16 | else case "$1" in
|
---|
17 | /*) f="$1" ;;
|
---|
18 | *) f="$dir/$1" ;;
|
---|
19 | esac
|
---|
20 | fi
|
---|
21 |
|
---|
22 | cd $TMP
|
---|
23 | rm -f $PI
|
---|
24 |
|
---|
25 | if [ -f $PI ]
|
---|
26 | then echo "$PI is in $TMP, please remove it first."
|
---|
27 | exit 1
|
---|
28 | fi
|
---|
29 |
|
---|
30 | if [ ! -f $f ]
|
---|
31 | then echo "Couldn't find package $f."
|
---|
32 | exit 1
|
---|
33 | fi
|
---|
34 |
|
---|
35 | # can we execute bunzip2?
|
---|
36 | if bunzip2 --help 2>&1 | grep usage >/dev/null
|
---|
37 | then BUNZIP2=bunzip2
|
---|
38 | else BUNZIP2=smallbunzip2
|
---|
39 | fi
|
---|
40 |
|
---|
41 | cat $f | $BUNZIP2 | pax -r -p e
|
---|
42 | if [ -f $PI ]
|
---|
43 | then
|
---|
44 | sh -e $PI
|
---|
45 | rm -f $PI
|
---|
46 | fi
|
---|
47 |
|
---|
48 | for d in /usr/man /usr/local/man /usr/gnu/man /usr/X11R6/man
|
---|
49 | do if [ -d "$d" ]
|
---|
50 | then makewhatis $d
|
---|
51 | fi
|
---|
52 | done
|
---|
Note:
See
TracBrowser
for help on using the repository browser.