* In doebuild(), don't create directories for the "clean" or "unmerge".
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Nov 2007 19:05:27 +0000 (19:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Nov 2007 19:05:27 +0000 (19:05 -0000)
* Fix dyn_clean() to clean the status file and return early when appropriate.
(trunk r8692)

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

bin/ebuild.sh
pym/portage.py

index b8ca584d4487684c95137f6d011deb621132a276..9c4436697371978c45d2c7b0a5118151eb0c3c4d 100755 (executable)
@@ -659,8 +659,9 @@ dyn_clean() {
        if [ -z "${PORTAGE_BUILDDIR}" ]; then
                echo "Aborting clean phase because PORTAGE_BUILDDIR is unset!"
                return 1
+       elif [ ! -d "${PORTAGE_BUILDDIR}" ] ; then
+               return 0
        fi
-
        if type -P chflags > /dev/null ; then
                chflags -R noschg,nouchg,nosappnd,nouappnd "${PORTAGE_BUILDDIR}"
                chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
@@ -675,6 +676,7 @@ dyn_clean() {
        fi
 
        if ! hasq keepwork $FEATURES; then
+               rm -rf "${PORTAGE_BUILDDIR}/.exit_status"
                rm -rf "${PORTAGE_BUILDDIR}/.logid"
                rm -rf "${PORTAGE_BUILDDIR}/.unpacked"
                rm -rf "${PORTAGE_BUILDDIR}/.compiled"
index 963090086e5afb33a4119cfa5b0a8a0a65c5e970..7f0a54ce465a7549a3e535c7bf1241b2d99dd1b9 100644 (file)
@@ -4220,9 +4220,13 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                "correct your PORTAGE_TMPDIR setting.\n", noiselevel=-1)
                        return 1
 
+               if mydo == "unmerge":
+                       return unmerge(mysettings["CATEGORY"],
+                               mysettings["PF"], myroot, mysettings, vartree=vartree)
+
                # Build directory creation isn't required for any of these.
                have_build_dirs = False
-               if mydo not in ("digest", "fetch", "help", "manifest"):
+               if mydo not in ("clean", "digest", "fetch", "help", "manifest"):
                        mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
                        if mystatus:
                                return mystatus
@@ -4231,15 +4235,11 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        logfile = mysettings.get("PORTAGE_LOG_FILE")
                        if logfile and not os.access(os.path.dirname(logfile), os.W_OK):
                                logfile = None
-                               
                if have_build_dirs:
                        _doebuild_exit_status_unlink(
                                mysettings.get("EBUILD_EXIT_STATUS_FILE"))
                else:
                        mysettings.pop("EBUILD_EXIT_STATUS_FILE", None)
-               if mydo == "unmerge":
-                       return unmerge(mysettings["CATEGORY"],
-                               mysettings["PF"], myroot, mysettings, vartree=vartree)
 
                # if any of these are being called, handle them -- running them out of
                # the sandbox -- and stop now.