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/mage3.sh,v 1.11 2005-06-01 15:48:23 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage3.sh,v 1.20 2005-08-28 19:20:08 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-r15 |
MAGEVERSION="$( < ${MLIBDIR}/version)" |
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 |
|
if [[ ${NOCOLORS} = true ]] |
23 |
|
then |
24 |
|
COLRED="" |
25 |
|
COLGREEN="" |
26 |
|
COLYELLOW="" |
27 |
|
COLBLUE="" |
28 |
|
COLMAGENTA="" |
29 |
|
COLWHITE="" |
30 |
|
COLDEFAULT="" |
31 |
|
fi |
32 |
|
|
33 |
# default path |
# default path |
34 |
PATH="${PATH}:${MLIBDIR}" |
PATH="${PATH}:${MLIBDIR}" |
35 |
|
|
36 |
|
# export the default C locale |
37 |
|
export LC_ALL=C |
38 |
|
|
39 |
##functions |
##functions |
40 |
if [ -f /etc/mage.rc ] |
if [ -f /etc/mage.rc ] |
41 |
then |
then |
166 |
unset DB_VIRTUAL_NAME DB_PKG_NAME |
unset DB_VIRTUAL_NAME DB_PKG_NAME |
167 |
rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/} |
rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/} |
168 |
fi |
fi |
169 |
|
|
170 |
if [ -n "${PROVIDE}" ] |
if [ -n "${PROVIDE}" ] |
171 |
then |
then |
172 |
local my_pgk |
# wander through all provides |
173 |
#cut arch |
local my_provides |
174 |
my_pkg=${PKGNAME/-${ARCH}/} |
for my_provides in ${PROVIDE} |
175 |
#cut version & build |
do |
176 |
my_pkg=${my_pkg%-*-*} |
local my_pgk |
177 |
|
#cut arch |
178 |
virtuals_add ${PROVIDE} ${CATEGORIE}/${my_pkg} |
my_pkg=${PKGNAME/-${ARCH}/} |
179 |
|
#cut version & build |
180 |
|
my_pkg=${my_pkg%-*-*} |
181 |
|
|
182 |
|
virtuals_add ${my_provides} ${CATEGORIE}/${my_pkg} |
183 |
|
done |
184 |
unset PROVIDE |
unset PROVIDE |
185 |
|
unset my_provides |
186 |
fi |
fi |
187 |
} |
} |
188 |
|
|
206 |
do |
do |
207 |
# continue if not a directory, |
# continue if not a directory, |
208 |
# or the same PNAME-PVER-PBUILD |
# or the same PNAME-PVER-PBUILD |
209 |
if [ ! -d "${directory}" ] |
if [ ! -d "${directory}" ] |
210 |
then |
then |
211 |
continue |
continue |
212 |
fi |
fi |
222 |
done |
done |
223 |
|
|
224 |
#virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg} |
#virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg} |
225 |
|
|
226 |
#my_pkg has already the categorie -> ex my_pkg=x11-base/xfree |
# wander through all provides |
227 |
virtuals_del ${PROVIDE} ${my_pkg} |
local my_provides |
228 |
|
for my_provides in ${PROVIDE} |
229 |
|
do |
230 |
|
#my_pkg has already the categorie -> ex my_pkg=x11-base/xfree |
231 |
|
virtuals_del ${my_provides} ${my_pkg} |
232 |
|
done |
233 |
|
|
234 |
unset PROVIDE |
unset PROVIDE |
235 |
|
unset my_provides |
236 |
fi |
fi |
237 |
} |
} |
238 |
|
|
588 |
MY_CAT_FIX="$(dirname ${i})" |
MY_CAT_FIX="$(dirname ${i})" |
589 |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
CATEGORIE="$(basename ${MY_CAT_FIX%/*})" |
590 |
#builds the package from source |
#builds the package from source |
591 |
${MLIBDIR}/sourceinstall.sh ${i} || exit 1 |
${MLIBDIR}/sourceinstall.sh ${i} "${MAGE_TARGETS}" || exit 1 |
592 |
done |
done |
593 |
run_etc_update |
run_etc_update |
594 |
;; |
;; |
668 |
version) |
version) |
669 |
showversion |
showversion |
670 |
;; |
;; |
671 |
|
regen-mage-tree) |
672 |
|
if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ] |
673 |
|
then |
674 |
|
echo "SMAGESCRIPTSDIR not found. Check your mage.rc or check out smage repos." |
675 |
|
exit 1 |
676 |
|
fi |
677 |
|
for i in $(find ${SMAGESCRIPTSDIR} -type f -name "*.smage2") |
678 |
|
do |
679 |
|
smage2 only-regen-tree "${i}" |
680 |
|
done |
681 |
|
;; |
682 |
*) |
*) |
683 |
print_usage |
print_usage |
684 |
;; |
;; |