1 |
#!/bin/sh |
#!/bin/sh |
2 |
# Magellan Linux Installer (mage.sh) |
# Magellan Linux Installer (mage.sh) |
3 |
# version: 0.3.6-r8 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage3.sh,v 1.14 2005-07-23 16:34:52 niro Exp $ |
4 |
|
|
5 |
##configuration -> mage.rc |
##configuration -> mage.rc |
6 |
#PKGDIR="/usr/src/packages" |
#PKGDIR="/usr/src/packages" |
11 |
MAGENAME="$2" |
MAGENAME="$2" |
12 |
#PKGNAME="`basename $2 .mage`" |
#PKGNAME="`basename $2 .mage`" |
13 |
MLIBDIR=/usr/lib/mage |
MLIBDIR=/usr/lib/mage |
14 |
MAGEVERSION=0.3.6-r8 |
MAGEVERSION=0.3.6-r18 |
15 |
|
|
16 |
## nur für tests -> normalerweise in /etc/rc.d/init.d/functions |
## nur für tests -> normalerweise in /etc/rc.d/init.d/functions |
17 |
COLRED="\033[1;6m\033[31m" |
COLRED="\033[1;6m\033[31m" |
19 |
COLBLUE="\033[1;6m\033[34m" |
COLBLUE="\033[1;6m\033[34m" |
20 |
COLDEFAULT="\033[0m" |
COLDEFAULT="\033[0m" |
21 |
|
|
22 |
|
# default path |
23 |
|
PATH="${PATH}:${MLIBDIR}" |
24 |
|
|
25 |
##functions |
##functions |
26 |
if [ -f /etc/mage.rc ] |
if [ -f /etc/mage.rc ] |
152 |
unset DB_VIRTUAL_NAME DB_PKG_NAME |
unset DB_VIRTUAL_NAME DB_PKG_NAME |
153 |
rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/} |
rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/} |
154 |
fi |
fi |
155 |
|
|
156 |
if [ -n "${PROVIDE}" ] |
if [ -n "${PROVIDE}" ] |
157 |
then |
then |
158 |
local my_pgk |
# wander through all provides |
159 |
#cut arch |
local my_provides |
160 |
my_pkg=${PKGNAME/-${ARCH}/} |
for my_provides in ${PROVIDE} |
161 |
#cut version & build |
do |
162 |
my_pkg=${my_pkg%-*-*} |
local my_pgk |
163 |
|
#cut arch |
164 |
virtuals_add ${PROVIDE} ${CATEGORIE}/${my_pkg} |
my_pkg=${PKGNAME/-${ARCH}/} |
165 |
|
#cut version & build |
166 |
|
my_pkg=${my_pkg%-*-*} |
167 |
|
|
168 |
|
virtuals_add ${my_provides} ${CATEGORIE}/${my_pkg} |
169 |
|
done |
170 |
unset PROVIDE |
unset PROVIDE |
171 |
|
unset my_provides |
172 |
fi |
fi |
173 |
} |
} |
174 |
|
|
192 |
do |
do |
193 |
# continue if not a directory, |
# continue if not a directory, |
194 |
# or the same PNAME-PVER-PBUILD |
# or the same PNAME-PVER-PBUILD |
195 |
if [ ! -d "${directory}" ] |
if [ ! -d "${directory}" ] |
196 |
then |
then |
197 |
continue |
continue |
198 |
fi |
fi |
208 |
done |
done |
209 |
|
|
210 |
#virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg} |
#virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg} |
211 |
|
|
212 |
#my_pkg has already the categorie -> ex my_pkg=x11-base/xfree |
# wander through all provides |
213 |
virtuals_del ${PROVIDE} ${my_pkg} |
local my_provides |
214 |
|
for my_provides in ${PROVIDE} |
215 |
|
do |
216 |
|
#my_pkg has already the categorie -> ex my_pkg=x11-base/xfree |
217 |
|
virtuals_del ${my_provides} ${my_pkg} |
218 |
|
done |
219 |
|
|
220 |
unset PROVIDE |
unset PROVIDE |
221 |
|
unset my_provides |
222 |
fi |
fi |
223 |
} |
} |
224 |
|
|
463 |
download) |
download) |
464 |
choppkgname |
choppkgname |
465 |
getcategorie |
getcategorie |
466 |
get_highest_magefile |
get_highest_magefile || exit 1 |
467 |
source ${MAGEFILE} |
source ${MAGEFILE} |
468 |
getpackages |
getpackages |
469 |
;; |
;; |
471 |
pretend) |
pretend) |
472 |
choppkgname |
choppkgname |
473 |
getcategorie |
getcategorie |
474 |
get_highest_magefile |
get_highest_magefile || exit 1 |
475 |
${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE} |
${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE} |
476 |
#abort already installed |
#abort already installed |
477 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
485 |
srcpretend) |
srcpretend) |
486 |
choppkgname |
choppkgname |
487 |
getcategorie |
getcategorie |
488 |
get_highest_magefile |
get_highest_magefile || exit 1 |
489 |
${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE} |
${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE} |
490 |
#abort already installed |
#abort already installed |
491 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
501 |
declare -i PROTECT_COUNT=0 |
declare -i PROTECT_COUNT=0 |
502 |
choppkgname |
choppkgname |
503 |
getcategorie |
getcategorie |
504 |
get_highest_magefile |
get_highest_magefile || exit 1 |
505 |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})" |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})" |
506 |
#abort already installed |
#abort already installed |
507 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
526 |
unset preinstall |
unset preinstall |
527 |
unset postinstall |
unset postinstall |
528 |
|
|
529 |
|
#then source an evtl new generated profile |
530 |
|
[ -e /etc/profile ] && source /etc/profile |
531 |
|
|
532 |
#than install |
#than install |
533 |
MY_CAT_FIX="$(dirname ${i})" |
MY_CAT_FIX="$(dirname ${i})" |
534 |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
542 |
declare -i PROTECT_COUNT=0 |
declare -i PROTECT_COUNT=0 |
543 |
choppkgname |
choppkgname |
544 |
getcategorie |
getcategorie |
545 |
get_highest_magefile |
get_highest_magefile || exit 1 |
546 |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})" |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})" |
547 |
#abort already installed |
#abort already installed |
548 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
567 |
unset preinstall |
unset preinstall |
568 |
unset postinstall |
unset postinstall |
569 |
|
|
570 |
|
#then source an evtl new generated profile |
571 |
|
[ -e /etc/profile ] && source /etc/profile |
572 |
|
|
573 |
#than srcinstall |
#than srcinstall |
574 |
MY_CAT_FIX="$(dirname ${i})" |
MY_CAT_FIX="$(dirname ${i})" |
575 |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |