From 33d566acc5ca42de1e6eef190ed8e75c7621eeb4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 9 Dec 2006 20:45:48 +0000 Subject: [PATCH] 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 --- bin/ebuild.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 -- 2.26.2