Improve the process for GNU tools
[minix3.git] / minix / commands / pkgin_cd / pkgin_cd.sh
blob697d45192693a64572af58869c911070282d00e8
1 #!/bin/sh
3 # This script can be used to install packages from the
4 # the installation CD-ROM.
6 RC=/usr/etc/rc.package
7 CDMP=/mnt
8 CDPACK=${CDMP}/install/packages
9 PACKSUM=pkg_summary.bz2
10 cdpackages=""
11 cdmounted=""
13 if [ -f "$RC" ]
14 then . "$RC"
17 # Is there a usable CD to install packages from?
18 if [ -n "$cddrive" ]
19 then pack=${cddrive}p2
20 umount $pack >/dev/null 2>&1 || true
21 echo "Checking for CD in $pack."
22 if mount -r $pack $CDMP 2>/dev/null
23 then fn="$CDPACK/$PACKSUM"
24 echo "Found."
25 cdmounted=1
26 cdpackages=$fn
27 if [ ! -f $cdpackages ]
28 then cdpackages=""
29 echo "No package summary found on CD in $fn."
30 exit 1
32 else echo "Not found."
33 exit 1
35 else echo "Don't know where the install CD is. You can set it in $RC."
36 exit 1
39 # Set package repo to CD and populate package db
40 export PKG_REPOS=${CDPACK}
41 pkgin update
43 # Run pkgin
44 pkgin $@