source: trunk/minix/commands/scripts/packit.sh@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

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