--- trunk/mage/usr/lib/mage/smage2.sh 2005/08/20 15:32:59 194 +++ trunk/mage/usr/lib/mage/smage2.sh 2005/08/20 15:51:14 195 @@ -4,7 +4,7 @@ # needs pkgbuild_dir (mage) # SMAGE2 -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.25 2005-08-20 15:32:59 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.26 2005-08-20 15:51:14 niro Exp $ #01.10.2004 # added ccache support @@ -408,7 +408,7 @@ # fixes given dependencies to match a MAGE_TARGET -# fix_mage_deps -target s/depend # <-- '-' is essential ! (build_mage_script needs this) +# fix_mage_deps target s/depend fix_mage_deps() { local target="$1" local depend="$2" @@ -438,10 +438,10 @@ # do not add empty lines if [ -z "${NDEPEND}" ] then - NDEPEND="${sym} ${cat}/${pname}${target}-${pver}" + NDEPEND="${sym} ${cat}/${pname}-${target}-${pver}" else NDEPEND="${NDEPEND} - ${sym} ${cat}/${pname}${target}-${pver}" + ${sym} ${cat}/${pname}-${target}-${pver}" fi unset cat pname pver @@ -478,7 +478,7 @@ # MAGE_TREE_DEST target destination of the generated tree # REGEN_MAGE_TREE set to 'true' to enable this # -# gets called with build_mage_script target # <-- '-' is essential ! +# gets called with build_mage_script target build_mage_script() { local magefile @@ -491,7 +491,7 @@ : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree} # determinate which suffix this mage file should get, if any - target="$1" + [ -n "$1" ] && target="-$1" # name of magefile magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage" @@ -508,7 +508,7 @@ > ${dest} # header - echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.25 2005-08-20 15:32:59 niro Exp $' >> ${dest} + echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.26 2005-08-20 15:51:14 niro Exp $' >> ${dest} echo >> ${dest} # pgkname and state @@ -583,13 +583,23 @@ # build them only if requested if [[ ${REGEN_MAGE_TREE} = true ]] then - # build for each target an mage file - for i in ${MAGE_TARGETS} - do + # run it without targets + if [ -z "${MAGE_TARGETS}" ] + then echo - build_mage_script "-${i}" + build_mage_script echo - done + else + + # build for each target an mage file + # run it with several targets + for i in ${MAGE_TARGETS} + do + echo + build_mage_script "${i}" + echo + done + fi fi # now unset all uneeded vars to be safe