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

svn path=/main/branches/2.1.2/; revision=9578

bin/ebuild.sh

index 395510fb6962bd4da47ccef931d7850cc7f2e09d..fb2e2a3a58e2adee116ee5c9a4f6e86c7e27db6b 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