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.11 2005-06-01 15:48:23 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-r15 |
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 ] |
171 |
if [ -n "${PROVIDE}" ] |
if [ -n "${PROVIDE}" ] |
172 |
then |
then |
173 |
local my_pgk |
local my_pgk |
174 |
|
local my_cat |
175 |
|
local directory |
176 |
|
local x |
177 |
|
|
178 |
#cut arch |
#cut arch |
179 |
my_pkg=${PKGNAME/-${ARCH}/} |
my_pkg=${PKGNAME/-${ARCH}/} |
180 |
|
|
181 |
#cut version & build |
#cut version & build |
182 |
my_pkg=${my_pkg%-*-*} |
my_pkg=${my_pkg%-*-*} |
183 |
|
my_cat=$(dirname ${my_pkg}) |
184 |
|
|
185 |
|
#check if this was the last one or if any other exists |
186 |
|
for directory in ${INSTALLDB}/${my_cat}/* |
187 |
|
do |
188 |
|
# continue if not a directory, |
189 |
|
# or the same PNAME-PVER-PBUILD |
190 |
|
if [ ! -d "${directory}" ] |
191 |
|
then |
192 |
|
continue |
193 |
|
fi |
194 |
|
|
195 |
|
#check if $directory is the same as $my_pkg |
196 |
|
x=$(basename ${directory}) |
197 |
|
if [[ ${my_cat}/${x%-*-*} = ${my_pkg} ]] |
198 |
|
then |
199 |
|
# break here |
200 |
|
echo "==== another version of ${my_pkg} exists, not deleting ${VIRTUAL_NAME} ..." |
201 |
|
return 0 |
202 |
|
fi |
203 |
|
done |
204 |
|
|
205 |
#virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg} |
#virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg} |
206 |
|
|
207 |
#my_pkg has already the categorie -> ex my_pkg=x11-base/xfree |
#my_pkg has already the categorie -> ex my_pkg=x11-base/xfree |
452 |
download) |
download) |
453 |
choppkgname |
choppkgname |
454 |
getcategorie |
getcategorie |
455 |
get_highest_magefile |
get_highest_magefile || exit 1 |
456 |
source ${MAGEFILE} |
source ${MAGEFILE} |
457 |
getpackages |
getpackages |
458 |
;; |
;; |
460 |
pretend) |
pretend) |
461 |
choppkgname |
choppkgname |
462 |
getcategorie |
getcategorie |
463 |
get_highest_magefile |
get_highest_magefile || exit 1 |
464 |
${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE} |
${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE} |
465 |
#abort already installed |
#abort already installed |
466 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
474 |
srcpretend) |
srcpretend) |
475 |
choppkgname |
choppkgname |
476 |
getcategorie |
getcategorie |
477 |
get_highest_magefile |
get_highest_magefile || exit 1 |
478 |
${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE} |
${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE} |
479 |
#abort already installed |
#abort already installed |
480 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
490 |
declare -i PROTECT_COUNT=0 |
declare -i PROTECT_COUNT=0 |
491 |
choppkgname |
choppkgname |
492 |
getcategorie |
getcategorie |
493 |
get_highest_magefile |
get_highest_magefile || exit 1 |
494 |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})" |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})" |
495 |
#abort already installed |
#abort already installed |
496 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
515 |
unset preinstall |
unset preinstall |
516 |
unset postinstall |
unset postinstall |
517 |
|
|
518 |
|
#then source an evtl new generated profile |
519 |
|
[ -e /etc/profile ] && source /etc/profile |
520 |
|
|
521 |
#than install |
#than install |
522 |
MY_CAT_FIX="$(dirname ${i})" |
MY_CAT_FIX="$(dirname ${i})" |
523 |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
531 |
declare -i PROTECT_COUNT=0 |
declare -i PROTECT_COUNT=0 |
532 |
choppkgname |
choppkgname |
533 |
getcategorie |
getcategorie |
534 |
get_highest_magefile |
get_highest_magefile || exit 1 |
535 |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})" |
ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})" |
536 |
#abort already installed |
#abort already installed |
537 |
if [ "$?" == "3" ] |
if [ "$?" == "3" ] |
556 |
unset preinstall |
unset preinstall |
557 |
unset postinstall |
unset postinstall |
558 |
|
|
559 |
|
#then source an evtl new generated profile |
560 |
|
[ -e /etc/profile ] && source /etc/profile |
561 |
|
|
562 |
#than srcinstall |
#than srcinstall |
563 |
MY_CAT_FIX="$(dirname ${i})" |
MY_CAT_FIX="$(dirname ${i})" |
564 |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |