1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
3 |
#depwalker |
# dependeny walker |
|
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/depwalker.sh,v 1.9 2008-02-26 19:51:40 niro Exp $ |
|
4 |
|
|
5 |
# default die function |
# default die function |
6 |
die() |
die() |
21 |
source ${MLIBDIR}/mage4.functions.sh || \ |
source ${MLIBDIR}/mage4.functions.sh || \ |
22 |
die "mage functions missing" |
die "mage functions missing" |
23 |
|
|
|
# for tests only |
|
|
# source /home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage/mage.rc.global |
|
|
# source /etc/mage.rc |
|
|
# source /home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh |
|
|
# MLIBDIR=/home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage |
|
|
|
|
|
# not serious if missing, only needed for colors |
|
|
[ -f /etc/init.d/functions ] && source /etc/init.d/functions |
|
|
|
|
|
# disable colors if wanted |
|
|
if [[ ${NOCOLORS} = true ]] |
|
|
then |
|
|
COLRED="" |
|
|
COLGREEN="" |
|
|
COLYELLOW="" |
|
|
COLBLUE="" |
|
|
COLMAGENTA="" |
|
|
COLWHITE="" |
|
|
COLDEFAULT="" |
|
|
fi |
|
|
|
|
24 |
usage() |
usage() |
25 |
{ |
{ |
26 |
echo |
echo |
35 |
echo " install, srcinstall, depend, srcdepend" |
echo " install, srcinstall, depend, srcdepend" |
36 |
echo " upgrade, srcupgrade" |
echo " upgrade, srcupgrade" |
37 |
echo |
echo |
38 |
echo "method,name, version and build must be given !" |
echo "method, name, version and build must be given !" |
39 |
echo |
echo |
40 |
exit 1 |
exit 1 |
41 |
} |
} |
121 |
DFILE="$1" |
DFILE="$1" |
122 |
|
|
123 |
source ${DFILE} |
source ${DFILE} |
124 |
|
|
125 |
|
# forced nodeps |
126 |
|
if [[ ${NODEPS} = true ]] |
127 |
|
then |
128 |
|
DEPEND="" |
129 |
|
SDEPEND="" |
130 |
|
fi |
131 |
|
|
132 |
MY_DEPEND="${DEPEND}" |
MY_DEPEND="${DEPEND}" |
133 |
|
|
134 |
# for srcinstall & srcdepend only; SDEPEND also needed |
# for srcinstall & srcdepend only; SDEPEND also needed |
230 |
# get the highest mage file from mage-db |
# get the highest mage file from mage-db |
231 |
MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" |
MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" |
232 |
|
|
233 |
|
# if no install candidate was found, record this |
234 |
|
# and process with the next one |
235 |
|
if [[ -z ${MAGEFILE} ]] |
236 |
|
then |
237 |
|
NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}" |
238 |
|
continue |
239 |
|
fi |
240 |
|
|
241 |
# now get the pver&pbuild from the new file |
# now get the pver&pbuild from the new file |
242 |
PVER="$(magename2pver ${MAGEFILE})" |
PVER="$(magename2pver ${MAGEFILE})" |
243 |
PBUILD="$(magename2pbuild ${MAGEFILE})" |
PBUILD="$(magename2pbuild ${MAGEFILE})" |
303 |
echo "done" |
echo "done" |
304 |
echo -e "${list}" |
echo -e "${list}" |
305 |
echo |
echo |
306 |
|
|
307 |
|
if [[ ! -z ${NO_UPGRADE_CANDIDATE} ]] |
308 |
|
then |
309 |
|
echo -e "${COLRED}Currently no candidates found for:${COLDEFAULT}" |
310 |
|
for i in ${NO_UPGRADE_CANDIDATE} |
311 |
|
do |
312 |
|
echo -e "${COLRED} ${i}${COLDEFAULT}" |
313 |
|
done |
314 |
|
echo |
315 |
|
echo -e "${COLRED}Please consider to uninstall all of them first,${COLDEFAULT}" |
316 |
|
echo -e "${COLRED}because these packages does not exist in this distribution${COLDEFAULT}" |
317 |
|
echo -e "${COLRED}anymore and there will be no further support for them.${COLDEFAULT}" |
318 |
|
echo |
319 |
|
fi |
320 |
fi |
fi |
321 |
|
|
322 |
## return output from src/install deps |
## return output from src/install deps |