Bug #213698 - Make FEAUTURES=keepwork and keeptemp preserve ${T}/environment
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 04:55:41 +0000 (04:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 04:55:41 +0000 (04:55 -0000)
since it may contain essential state.

svn path=/main/trunk/; revision=9526

bin/ebuild.sh

index b522f8db0d1974c673e99908ab907af920d0e7cd..33c6d12c34e4c03316602ffd2c4180ee13cb624f 100755 (executable)
@@ -650,11 +650,9 @@ dyn_unpack() {
        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
+               if [ -d "${T}" ] && \
+                       ! hasq keeptemp $FEATURES && ! hasq keepwork $FEATURES ; then
                        rm -rf "${T}" && mkdir "${T}"
-               else
-                       [ -e "${T}/environment" ] && \
-                               mv "${T}/environment" "${T}/environment.keeptemp"
                fi
        fi
        if [ -e "${WORKDIR}" ]; then
@@ -692,10 +690,8 @@ dyn_clean() {
 
        rm -rf "${PORTAGE_BUILDDIR}/image" "${PORTAGE_BUILDDIR}/homedir"
 
-       if ! hasq keeptemp $FEATURES; then
+       if ! hasq keeptemp $FEATURES && ! hasq keepwork $FEATURES ; then
                rm -rf "${T}"
-       else
-               [ -e "${T}/environment" ] && mv "${T}/environment" "${T}/environment.keeptemp"
        fi
 
        if ! hasq keepwork $FEATURES; then