URL1=http://www.minix3.org/packages/$PACKDIR
SRCURL1=http://www.minix3.org/software
PATH=/bin:/sbin:/usr/bin:/usr/sbin
+pack=""
+cdpackages=""
+netpackages=""
+cdmounted=""
if [ ! "$PAGER" ]
then PAGER=more
fi
}
+myexit()
+{
+ if [ -n "$cdmounted" -a -n "$pack" ]
+ then
+ umount $pack || true
+ fi
+
+ exit $1
+}
+
# can we execute bunzip2?
if bunzip2 --help 2>&1 | grep usage >/dev/null
then BUNZIP2=bunzip2
if id | fgrep "uid=0(" >/dev/null
then :
else echo "Please run $0 as root."
- exit 1
+ myexit 1
fi
chmod 700 $TMPDIR
# Make sure there is a $SRC dir
if [ ! -d "$SRC" ]
-then mkdir $SRC || exit
+then mkdir $SRC || myexit 1
fi
# Is there a usable CD to install packages from?
-cdpackages=""
if [ -n "$cddrive" ]
then pack=${cddrive}p2
umount $pack >/dev/null 2>&1 || true
if mount -r $pack $CDMP 2>/dev/null
then fn="$CDPACK/List"
echo "Found."
+ cdmounted=1
cdpackages=$fn
if [ ! -f $cdpackages ]
then cdpackages=""
rm -f $TMPDIR/.* # Remove any remaining .postinstall script or .list*
# Check for network packages too
-netpackages=""
if ( : </dev/tcp ) 2>/dev/null
then echo -n "Update package list from network? (Y/n) "
y=`myread`
# Is there at least one package type?
if [ ! -n "$netpackages" -a ! -n "$cdpackages" ]
then echo "No packages found."
- exit 1
+ myexit 1
fi
# Is there more than one package type?
echo -n "Package(s) to install (RETURN or q to exit)? "
packnolist=`myread`
if [ "$packnolist" = "" -o "$packnolist" = "q" ]
- then exit 0
+ then myexit 0
fi
if [ "$packnolist" = all ]
then packnolist=1-$highest
else echo "Retrieval failed."
fi
if [ "$getsources" = y -o "$getsources" = Y ]
- then ( cd $SRC || exit
+ then ( cd $SRC || myexit 2
srcfile=${packagename}-src.tar.bz2
echo "Retrieving source from $srcurl .."
- urlget $srcurl >$srcfile || exit
+ urlget $srcurl >$srcfile || myexit 3
echo "Source retrieved in $SRC/$srcfile."
- $BUNZIP2 -dc $srcfile | tar xf - >/dev/null || exit
+ $BUNZIP2 -dc $srcfile | tar xf - >/dev/null || myexit 3
echo "Source unpacked in $SRC."
)
fi
srcfile=$CDSRC/${packagename}.tar.bz2
if [ -f $srcfile -a "$getsources" = y ]
then
- ( cd $SRC || exit
- $BUNZIP2 -dc $srcfile | tar xf - || exit
+ ( cd $SRC || myexit 2
+ $BUNZIP2 -dc $srcfile | tar xf - || myexit 3
echo "Source $srcfile unpacked in $SRC."
)
fi
done
rm -f $TMPDIR/.* # Remove any remaining .postinstall script or .list*
+myexit 0
--- /dev/null
+.TH PACKIT 8
+.SH NAME
+packit \- install binary packman package
+.SH SYNOPSIS
+\fBpackit
+.RB <package file>
+\fR
+.br
+.de FL
+.TP
+\\fB\\$1\\fR
+\\$2
+..
+.de EX
+.TP 20
+\\fB\\$1\\fR
+# \\$2
+..
+.SH DESCRIPTION
+.PP
+.I packit
+is used to install binary packman packages. In case a
+.B .postinstall
+file is present in the package, it will be executed using sh -e. Finally,
+.I packit
+installs (newly added) man pages located in the directories /usr/man,
+/usr/local/man, /usr/gnu/man, and /usr/X11R6/man.
+.SH "SEE ALSO"
+.BR packman (8).
--- /dev/null
+.TH PACKMAN 8
+.SH NAME
+packman \- install binary and source packages
+.SH SYNOPSIS
+\fBpackman\fR
+.br
+.de FL
+.TP
+\\fB\\$1\\fR
+\\$2
+..
+.de EX
+.TP 20
+\\fB\\$1\\fR
+# \\$2
+..
+.SH DESCRIPTION
+.PP
+\s-1MINIX 3\s-1
+uses
+.I packman
+to install binary and source packages from CD or repository.
+.I packman
+checks if a CD with packages (i.e.
+\s-1MINIX 3\s-1
+install disk) and a working network connection is present, and interactively
+ask you which of the available sources to use. In case you have a working
+networking connection,
+.I packman
+inquires to retrieve the latest package list. Subsequently, a list of available
+packages is shown and you are asked which packages to install.
+.SH "SEE ALSO"
+.BR packit (8).