--- trunk/mage/usr/lib/mage/depwalker.sh 2008/02/26 19:51:40 677 +++ trunk/mage/usr/lib/mage/depwalker.sh 2011/12/28 09:59:15 1562 @@ -1,7 +1,6 @@ #!/bin/bash - -#depwalker -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/depwalker.sh,v 1.9 2008-02-26 19:51:40 niro Exp $ +# $Id$ +# dependeny walker # default die function die() @@ -22,27 +21,6 @@ source ${MLIBDIR}/mage4.functions.sh || \ die "mage functions missing" -# 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 - usage() { echo @@ -57,7 +35,7 @@ echo " install, srcinstall, depend, srcdepend" echo " upgrade, srcupgrade" echo - echo "method,name, version and build must be given !" + echo "method, name, version and build must be given !" echo exit 1 } @@ -143,6 +121,14 @@ DFILE="$1" source ${DFILE} + + # forced nodeps + if [[ ${NODEPS} = true ]] + then + DEPEND="" + SDEPEND="" + fi + MY_DEPEND="${DEPEND}" # for srcinstall & srcdepend only; SDEPEND also needed @@ -199,7 +185,7 @@ PVER="$(magename2pver ${HIGHEST_DEPFILE})" PBUILD="$(magename2pbuild ${HIGHEST_DEPFILE})" - ## check ob schon in ALLDEPS enthalten dann mach weiter + ## dep already in ALLDEPS? then going on # usage of fgrep is extremly slow and consumes a lot of cpu power #if [ -z "$(echo ${ALLDEPS} | fgrep "${HIGHEST_DEPFILE}")" ] @@ -218,11 +204,6 @@ return 0 } - -### abort if this package is already installed (retval 3) -# maybe later ? -#[ -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] && exit 3 - [[ ${METHOD} = pretend ]] || \ [[ ${METHOD} = srcpretend ]] || \ [[ ${METHOD} = uppretend ]] || \ @@ -244,11 +225,19 @@ # get the highest mage file from mage-db MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" + # if no install candidate was found, record this + # and process with the next one + if [[ -z ${MAGEFILE} ]] + then + NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}" + continue + fi + # now get the pver&pbuild from the new file PVER="$(magename2pver ${MAGEFILE})" PBUILD="$(magename2pbuild ${MAGEFILE})" - # do not wander files which are installed + # do not walk files which are installed if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] then # get dependencies the package @@ -264,7 +253,7 @@ fi done else - # get dependencies the package + # get all dependencies of the package rumwandern ${MAGEFILE} # now add the package itself to the dependencies @@ -309,6 +298,20 @@ echo "done" echo -e "${list}" echo + + if [[ ! -z ${NO_UPGRADE_CANDIDATE} ]] + then + echo -e "${COLRED}Currently no candidates found for:${COLDEFAULT}" + for i in ${NO_UPGRADE_CANDIDATE} + do + echo -e "${COLRED} ${i}${COLDEFAULT}" + done + echo + echo -e "${COLRED}Please consider to uninstall all of them first,${COLDEFAULT}" + echo -e "${COLRED}because these packages does not exist in this distribution${COLDEFAULT}" + echo -e "${COLRED}anymore and there will be no further support for them.${COLDEFAULT}" + echo + fi fi ## return output from src/install deps @@ -317,6 +320,3 @@ [[ ${METHOD} = upgrade ]] || \ [[ ${METHOD} = srcupgrade ]] && \ echo "${ALLDEPS}" - -# delete ${BUILDDIR}/virtuals if exists as not needed anymore -#[ -d ${BUILDDIR}/virtuals ] && rm -rf ${BUILDDIR}/virtuals