--- trunk/mage/usr/lib/mage/depwalker.sh 2013/10/25 06:55:11 2269 +++ trunk/mage/usr/lib/mage/depwalker.sh 2013/11/20 12:21:28 2281 @@ -27,17 +27,18 @@ echo "Usage: $(basename $0) [command] [arg] ..." echo echo " -h --help shows this help" - echo " -c --pcat categorie of the package" + echo " -c --pcat category of the package" echo " -n --pname name of the package" echo " -v --pver version number of the package" echo " -b --pbuild build number of the package" echo " -m --method which calc method should be used:" echo " install, srcinstall, depend, srcdepend" echo " upgrade, srcupgrade," - echo " install-build-prerequisites, pretend-build-prerequisites" + echo " install-build-prerequisites," + echo " pretend-build-prerequisites" echo " -d --debug enable debug mode" echo - echo "method, name, version and build must be given !" + echo "method, category, name, version and build must be given !" echo exit 1 } @@ -126,6 +127,12 @@ DFILE="$1" + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: depwalking magefile '${DFILE}'" >&2 + echo >&2 + fi + source ${DFILE} # forced nodeps @@ -184,6 +191,10 @@ if [ -z "${MY_DEPEND}" ] then + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: MY_DEPEND is empty; deps of '${DFILE}' ignored" >&2 + fi return 1 fi @@ -234,6 +245,10 @@ then depwalking ${HIGHEST_DEPFILE} ALLDEPS="${ALLDEPS} ${HIGHEST_DEPFILE}" + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: added '${HIGHEST_DEPFILE}' to ALLDEPS" >&2 + fi fi fi done << EOF @@ -264,11 +279,23 @@ # get the highest mage file from mage-db MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: dep='${dep}'" >&2 + echo "DEBUG: PCAT='${PCAT}'" >&2 + echo "DEBUG: PNAME='${PNAME}'" >&2 + echo "DEBUG: MAGEFILE='${MAGEFILE}'" >&2 + fi + # 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}" + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: added to NO_UPGRADE_CANDIDATE" >&2 + fi continue fi @@ -276,11 +303,34 @@ PVER="$(magename2pver ${MAGEFILE})" PBUILD="$(magename2pbuild ${MAGEFILE})" + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: PVER='${PVER}'" >&2 + echo "DEBUG: PBUILD='${PBUILD}'" >&2 + fi + # do not walk files which are installed if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] then # get dependencies the package depwalking ${MAGEFILE} + + # now add the package itself to the dependencies + # (if not exists already) + if checklist_alldeps "${MAGEFILE}" + then + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: added '${MAGEFILE}' to ALLDEPS" >&2 + fi + ALLDEPS="${ALLDEPS} ${MAGEFILE}" + fi + else + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: ignored package" >&2 + echo >&2 + fi fi done else @@ -290,12 +340,20 @@ fi if [[ ${METHOD} != install-build-prerequisites ]] && - [[ ${METHOD} != pretend-build-prerequisites ]] + [[ ${METHOD} != pretend-build-prerequisites ]] && + [[ ${METHOD} != upgrade ]] && + [[ ${METHOD} != uppretend ]] && + [[ ${METHOD} != srcupgrade ]] && + [[ ${METHOD} != srcuppretend ]] then # now add the package itself to the dependencies # (if not exists already) if checklist_alldeps "${MAGEFILE}" then + if [[ ${DEBUG} = 1 ]] + then + echo "DEBUG: added '${MAGEFILE}' to ALLDEPS" >&2 + fi ALLDEPS="${ALLDEPS} ${MAGEFILE}" fi fi