--- trunk/mage/usr/lib/mage/smage2.sh 2009/04/26 15:57:42 832 +++ trunk/mage/usr/lib/mage/smage2.sh 2009/05/21 19:06:26 875 @@ -20,6 +20,8 @@ SMAGESUFFIX="smage2" MLIBDIR=/usr/lib/mage SMAGEVERSION="$( < ${MLIBDIR}/version)" +SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" + ## only for tests -> normally in /etc/rc.d/init.d/functions COLRED="\033[1;6m\033[31m" @@ -362,6 +364,7 @@ ./configure \ --prefix=/usr \ --host=${CHOST} \ + --build=${CHOST} \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --datadir=/usr/share \ @@ -936,6 +939,16 @@ echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}" } +step_by_step() +{ + if [[ ${STEP_BY_STEP} = true ]] + then + echo "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}" + echo "Press [enter] to continue" + read + fi +} + # print out our version showversion @@ -1202,9 +1215,16 @@ mage rmstamp fi -src_prepare || die "src_prepare failed" -src_compile || die "src_compile failed" -src_install || die "src_install failed" +# setup build loggins +[[ ! -d /var/log/smage ]] && install -d /var/log/smage +echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log + +( src_prepare || die "src_prepare failed" ) | ${SMAGE_LOG_CMD} +step_by_step $_ +( src_compile || die "src_compile failed" ) | ${SMAGE_LOG_CMD} +step_by_step $_ +( src_install || die "src_install failed" ) | ${SMAGE_LOG_CMD} +step_by_step $_ # compressing doc, info & man files @@ -1285,6 +1305,13 @@ ;; esac +if [[ ${SMAGE_BUILD_LOGGING} != false ]] +then + bzip2 -9f /var/log/smage/${PKGNAME}.log +else + [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log +fi + # for sure unset NOPKGBUILD unset NOSTRIP