--- trunk/mage/usr/lib/mage/smage2.functions.sh 2012/02/06 10:18:43 1683 +++ trunk/mage/usr/lib/mage/smage2.functions.sh 2012/02/06 10:22:30 1684 @@ -7,7 +7,8 @@ smagesource() { local file="$1" - local mystate + local localstate + local distfilestate local mytag source ${file} @@ -29,23 +30,22 @@ fi fi - [[ -n ${STATE} ]] && mystate="${STATE}" + [[ -n ${STATE} ]] && localstate="${STATE}" [[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}" - # do not overide if local state was broken or disabled! - case ${STATE} in - broken) return ;; - disabled) return ;; - esac - if [ -f ${SMAGESCRIPTSDIR}/distribution ] then source ${SMAGESCRIPTSDIR}/distribution - [[ -n ${STATE} ]] && mystate="${STATE}" + [[ -n ${STATE} ]] && distfilestate="${STATE}" [[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}" fi - # now switch state and export it - STATE="${mystate}" + # now switch state and export it but do not overide any local states + if [[ ! -z ${localstate} ]] + then + STATE="${localstate}" + else + STATE="${distfilestate}" + fi if mqueryfeature "pkgdistrotag" then @@ -59,7 +59,7 @@ echo -e "${COLRED}Requested 'pkgdistrotag' but no \$DISTROTAG found!${COLDEFAULT}" echo -e "${COLRED}Disabled the feature for pkgbuild sanity!${COLDEFAULT}" else - # now switch state and export it + # now switch state and export it but do not overide any local states export DISTROTAG="${mytag}" fi else