--- trunk/mage/usr/lib/mage/mage4.sh 2005/12/04 17:12:07 299 +++ trunk/mage/usr/lib/mage/mage4.sh 2007/01/19 23:15:04 413 @@ -1,10 +1,11 @@ #!/bin/sh # Magellan Linux Installer (mage.sh) -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.11 2005-12-04 17:12:07 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.15 2007-01-19 23:15:04 niro Exp $ # default die function die() { + echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT} echo -e ${COLRED}"$@"${COLDEFAULT} exit 1 } @@ -113,9 +114,6 @@ showversion echo -# before anything run mage_setup -mage_setup || die "error in mage_setup()" - # install method METHOD="$1" @@ -142,6 +140,9 @@ BUILDDIR=${MROOT}/${BUILDDIR} fi +# before anything run mage_setup +mage_setup || die "error in mage_setup()" + case ${METHOD} in download) # first of all get the right pkg which going to be installed @@ -153,6 +154,9 @@ # source the highest magefile of this pkg PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) + # package is masked + [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." + # convert PKGNAME to PNAME/PVER/PBUILD # we're working *only* with these three vars from here on PNAME="$(pkgname2pname ${PKGNAME})" @@ -180,6 +184,9 @@ # source the highest magefile of this pkg PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) + # package is masked + [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." + # convert PKGNAME to PNAME/PVER/PBUILD # we're working *only* with these three vars from here on PNAME="$(pkgname2pname ${PKGNAME})" @@ -206,6 +213,9 @@ # source the highest magefile of this pkg PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) + # package is masked + [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." + # convert PKGNAME to PNAME/PVER/PBUILD # we're working *only* with these three vars from here on PNAME="$(pkgname2pname ${PKGNAME})" @@ -239,6 +249,9 @@ # source the highest magefile of this pkg PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) + # package is masked + [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." + # convert PKGNAME to PNAME/PVER/PBUILD # we're working *only* with these three vars from here on PNAME="$(pkgname2pname ${PKGNAME})" @@ -278,6 +291,9 @@ # source the highest magefile of this pkg PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) + # package is masked + [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." + # convert PKGNAME to PNAME/PVER/PBUILD # we're working *only* with these three vars from here on PNAME="$(pkgname2pname ${PKGNAME})" @@ -365,6 +381,9 @@ # source the highest magefile of this pkg PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) + # package is masked + [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." + # convert PKGNAME to PNAME/PVER/PBUILD # we're working *only* with these three vars from here on PNAME="$(pkgname2pname ${PKGNAME})"