summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-26 19:02:05 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-26 19:02:05 +0000
commit9794d481c67bb84eedc583e813ba079fcb7cbc08 (patch)
tree0ad35f7cc68e14e24bd2f95cf52158aa12e7d13f
parent6e62223fe876d75c0e4f3e1cfcc33fa94e2cdaa6 (diff)
downloadportage-9794d481c67bb84eedc583e813ba079fcb7cbc08.tar.gz
portage-9794d481c67bb84eedc583e813ba079fcb7cbc08.tar.bz2
portage-9794d481c67bb84eedc583e813ba079fcb7cbc08.zip
* In doebuild(), don't create directories for the "clean" or "unmerge".
* Fix dyn_clean() to clean the status file and return early when appropriate. svn path=/main/trunk/; revision=8692
-rwxr-xr-xbin/ebuild.sh4
-rw-r--r--pym/portage/__init__.py10
2 files changed, 8 insertions, 6 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b8ca584d4..9c4436697 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -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"
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 29fcbda54..67b461db2 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4261,9 +4261,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
@@ -4272,15 +4276,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.