From: Zac Medico Date: Sat, 9 Dec 2006 20:45:48 +0000 (-0000) Subject: For bug #157369, clean when cleanup has been triggered by changed timestamps. ... X-Git-Tag: v2.1.2~340 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=33d566acc5ca42de1e6eef190ed8e75c7621eeb4;p=portage.git For bug #157369, clean when cleanup has been triggered by changed timestamps. Also, allow FEATURES=keepwork to override the ebuild mtime check. svn path=/main/trunk/; revision=5244 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 697ef494e..fcb7438ed 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -679,18 +679,25 @@ dyn_unpack() { if [ "${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/${x}" -nt "${WORKDIR}" ]; then vecho ">>> ${x} has been updated; recreating WORKDIR..." newstuff="yes" - rm -rf "${WORKDIR}" break fi done - if [ "${EBUILD}" -nt "${WORKDIR}" ]; then + if [ "${EBUILD}" -nt "${WORKDIR}" ] && ! hasq keepwork ${FEATURES} ; then vecho ">>> ${EBUILD} has been updated; recreating WORKDIR..." newstuff="yes" - rm -rf "${WORKDIR}" elif [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then vecho ">>> Not marked as unpacked; recreating WORKDIR..." newstuff="yes" - rm -rf "${WORKDIR}" + fi + fi + if [ "${newstuff}" == "yes" ]; then + # We don't necessarily have privileges to do a full dyn_clean here. + rm -rf "${WORKDIR}" + if [ -d "${T}" ] && ! hasq keeptemp ${FEATURES} ; then + rm -rf "${T}" && mkdir "${T}" + else + [ -e "${T}/environment" ] && \ + mv "${T}/environment" "${T}/environment.keeptemp" fi fi if [ -e "${WORKDIR}" ]; then