--- trunk/mage/usr/lib/mage/smage2.sh 2012/03/12 23:27:53 1784 +++ trunk/mage/usr/lib/mage/smage2.sh 2013/02/01 09:50:07 2042 @@ -409,6 +409,12 @@ split_info_${subpackage} if [[ ${PKGTYPE} = virtual ]] then + echo + echo -en "${COLBLUE}*** ${COLDEFAULT}" + echo -en "Virtual package detected" + echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" + echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." + echo "virtual package detected; nothing will be build ..." # automatically set !pkgbuild here too msetfeature "!pkgbuild" @@ -423,7 +429,7 @@ echo echo -en "${COLBLUE}*** ${COLDEFAULT}" - echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" + echo -en "Running ${COLGREEN}split src_install()${COLDEFAULT}" echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." @@ -433,9 +439,9 @@ step_by_step src_install_${subpackage} fi fi + # restore smage environment + split_restore_variables done - # restore bindir & pname - split_restore_variables # unset all saved smage variables split_unset_variables else @@ -459,11 +465,28 @@ # compressing doc, info & man files if [[ -n ${SPLIT_PACKAGES} ]] then + # save smage environment + split_save_variables for subpackage in ${SPLIT_PACKAGES} do - run_resume post-mcompressdoc_${subpackage} || mcompressdocs ${BINDIR}_${subpackage} - resume_stamp post-mcompressdoc_${subpackage} + # honor split_info + split_info_${subpackage} + + if mqueryfeature "!compressdoc" + then + echo -e "!compressdoc detected; documentation of '${subpackage}' will not be compressed ..." + elif mqueryfeature "!pkgbuild" + then + echo "!pkgbuild detected; skipping documentation compression for '${subpackage}' ..." + else + run_resume post-mcompressdoc_${subpackage} || mcompressdocs ${BINDIR}_${subpackage} + resume_stamp post-mcompressdoc_${subpackage} + fi + # restore smage environment + split_restore_variables done + # unset saved variables + split_unset_variables else run_resume post-mcompressdoc || mcompressdocs ${BINDIR} resume_stamp post-mcompressdoc @@ -478,12 +501,30 @@ else if [[ -n ${SPLIT_PACKAGES} ]] then + # save smage environment + split_save_variables for subpackage in ${SPLIT_PACKAGES} do - echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}" - run_resume post-mstriplibtoolarchive_${subpackage} || mstriplibtoolarchive ${BINDIR}_${subpackage} - resume_stamp post-mstriplibtoolarchive_${subpackage} + # honor split_info + split_info_${subpackage} + + if mqueryfeature "!libtool" + then + if mqueryfeature "!pkgbuild" + then + echo "!pkgbuild detected; skipping libtool archive stripping for '${subpackage}'..." + else + echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}" + run_resume post-mstriplibtoolarchive_${subpackage} || mstriplibtoolarchive ${BINDIR}_${subpackage} + resume_stamp post-mstriplibtoolarchive_${subpackage} + fi + fi + + # restore smage environment + split_restore_variables done + # unset saved variables + split_unset_variables else echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" run_resume post-mstriplibtoolarchive || mstriplibtoolarchive ${BINDIR} @@ -496,16 +537,34 @@ then if mqueryfeature "!pkgbuild" then - echo "!pkgbuild detected; skipping file purgation..." + echo "!pkgbuild detected; skipping file purgation ..." else if [[ -n ${SPLIT_PACKAGES} ]] then + # save smage environment + split_save_variables for subpackage in ${SPLIT_PACKAGES} do - echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}" - run_resume post-mpurgetargets_${subpackage} || mpurgetargets ${BINDIR}_${subpackage} - resume_stamp post-mpurgetargets_${subpackage} + # honor split_info + split_info_${subpackage} + + if mqueryfeature "purge" + then + if mqueryfeature "!pkgbuild" + then + echo "!pkgbuild detected; skipping file purgation for '${subpackage}' ..." + else + echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}" + run_resume post-mpurgetargets_${subpackage} || mpurgetargets ${BINDIR}_${subpackage} + resume_stamp post-mpurgetargets_${subpackage} + fi + fi + + # restore smage environment + split_restore_variables done + # unset saved variables + split_unset_variables else echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" run_resume post-mpurgetargets || mpurgetargets ${BINDIR} @@ -517,25 +576,43 @@ # stripping all bins and libs if mqueryfeature "!strip" then - echo -e "!strip detected; Package will not be stripped ..." + echo -e "!strip detected; package will not be stripped ..." elif mqueryfeature "!pkgbuild" then echo "!pkgbuild detected; skipping stripping of the package ..." else if [[ -n ${SPLIT_PACKAGES} ]] then + # save smage environment + split_save_variables for subpackage in ${SPLIT_PACKAGES} do - echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" - run_resume post-mstripbins_${subpackage} || mstripbins ${BINDIR}_${subpackage} - resume_stamp post-mstripbins_${subpackage} - echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" - run_resume post-mstriplibs_${subpackage} || mstriplibs ${BINDIR}_${subpackage} - resume_stamp post-mstriplibs_${subpackage} - echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" - run_resume post-mstripstatic_${subpackage} || mstripstatic ${BINDIR}_${subpackage} - resume_stamp post-mstripstatic_${subpackage} + # honor split_info + split_info_${subpackage} + + if mqueryfeature "!strip" + then + echo -e "!strip detected; package '${subpackage}' will not be stripped ..." + elif mqueryfeature "!pkgbuild" + then + echo "!pkgbuild detected; skipping stripping of the package '${subpackage}' ..." + else + echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" + run_resume post-mstripbins_${subpackage} || mstripbins ${BINDIR}_${subpackage} + resume_stamp post-mstripbins_${subpackage} + echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" + run_resume post-mstriplibs_${subpackage} || mstriplibs ${BINDIR}_${subpackage} + resume_stamp post-mstriplibs_${subpackage} + echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" + run_resume post-mstripstatic_${subpackage} || mstripstatic ${BINDIR}_${subpackage} + resume_stamp post-mstripstatic_${subpackage} + fi + + # restore smage environment + split_restore_variables done + # unset saved variables + split_unset_variables else echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" run_resume post-mstripbins || mstripbins ${BINDIR} @@ -601,7 +678,12 @@ fi # jump to next one if !pkgbuild is set in split_info - mqueryfeature "!pkgbuild" && continue + if mqueryfeature "!pkgbuild" + then + # restore smage environment + split_restore_variables + continue + fi # check if an special subpackage_pkgbuild exists if typeset -f ${PNAME}_pkgbuild > /dev/null