1 |
#!/bin/sh |
#!/bin/sh |
2 |
# Magellan Linux Installer (mage.sh) |
# Magellan Linux Installer (mage.sh) |
3 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.10 2005-12-04 12:02:21 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.13 2006-04-27 11:52:59 niro Exp $ |
4 |
|
|
5 |
# default die function |
# default die function |
6 |
die() |
die() |
73 |
|
|
74 |
print_usage() |
print_usage() |
75 |
{ |
{ |
76 |
showversion |
#showversion |
77 |
echo |
#echo |
78 |
echo "Usage: $(basename $0) [option] pkgname ..." |
echo "Usage: $(basename $0) [option] pkgname ..." |
79 |
echo "Options:" |
echo "Options:" |
80 |
echo " pretend - pretends dependencies of a package" |
echo " pretend - pretends dependencies of a package" |
113 |
showversion |
showversion |
114 |
echo |
echo |
115 |
|
|
|
# before anything run mage_setup |
|
|
mage_setup || die "error in mage_setup()" |
|
|
|
|
116 |
# install method |
# install method |
117 |
METHOD="$1" |
METHOD="$1" |
118 |
|
|
139 |
BUILDDIR=${MROOT}/${BUILDDIR} |
BUILDDIR=${MROOT}/${BUILDDIR} |
140 |
fi |
fi |
141 |
|
|
142 |
|
# before anything run mage_setup |
143 |
|
mage_setup || die "error in mage_setup()" |
144 |
|
|
145 |
case ${METHOD} in |
case ${METHOD} in |
146 |
download) |
download) |
147 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
153 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
154 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
155 |
|
|
156 |
|
# package does not exists |
157 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
158 |
|
|
159 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
160 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
161 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
183 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
184 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
185 |
|
|
186 |
|
# package does not exists |
187 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
188 |
|
|
189 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
190 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
191 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
212 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
213 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
214 |
|
|
215 |
|
# package does not exists |
216 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
217 |
|
|
218 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
219 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
220 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
248 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
249 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
250 |
|
|
251 |
|
# package does not exists |
252 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
253 |
|
|
254 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
255 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
256 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
290 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
291 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
292 |
|
|
293 |
|
# package does not exists |
294 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
295 |
|
|
296 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
297 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
298 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
380 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
381 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
382 |
|
|
383 |
|
# package does not exists |
384 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
385 |
|
|
386 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
387 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
388 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |