--- trunk/mage/usr/lib/mage/depwalker.sh 2014/01/06 12:36:37 2360 +++ branches/mage-next/src/depwalker.in 2014/03/05 08:18:22 2627 @@ -2,13 +2,6 @@ # $Id$ # dependeny walker -# default die function -die() -{ - echo ${COLRED}"$@"${COLDEFAULT} - exit 1 -} - decho() { if [[ ${DEBUG} = 1 ]] @@ -17,21 +10,16 @@ fi } -# include all needed files -[ -f /etc/mage.rc.global ] && \ - source /etc/mage.rc.global || \ - die "/etc/mage.rc.global missing" - -[ -f ${MAGERC} ] && source ${MAGERC} || \ - die "Your ${MAGERC} is missing. Aborting." - -[ -f ${MLIBDIR}/mage4.functions.sh ] && \ - source ${MLIBDIR}/mage4.functions.sh || \ - die "mage functions missing" - -[ -f ${MLIBDIR}/smage2.functions.sh ] && \ - source ${MLIBDIR}/smage2.functions.sh || \ - die "smage functions missing" +# set default variables +: ${MAGERC="@@SYSCONFDIR@@/mage.rc"} +: ${MLIBDIR="@@MAGELIBDIR@@"} + +# first of all include common functions +source ${MLIBDIR}/common.functions.sh || exit 1 +source @@SYSCONFDIR@@/mage.rc.global || die "@@SYSCONFDIR@@/mage.rc.global missing" +source ${MAGERC} || die "Your ${MAGERC} is missing. Aborting." +source ${MLIBDIR}/mage4.functions.sh || die "mage functions missing" +source ${MLIBDIR}/smage2.functions.sh || die "smage functions missing" usage() { @@ -312,10 +300,9 @@ ALLDEPS="${ALLDEPS} ${MAGEFILE}" fi else - # debug info - decho "ignored package" - decho - fi + # debug info + decho "ignored package" + decho fi done else