summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-29 04:27:57 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-29 04:27:57 +0000
commit6bffa0c9174750a1df600a45e8b6c5277107a5dd (patch)
tree9e991b67b0dbf0aaaa1a1f1d9634c5295cf4926e
parent44e9e854b09020727a0acff739e4230213627086 (diff)
downloadportage-6bffa0c9174750a1df600a45e8b6c5277107a5dd.tar.gz
portage-6bffa0c9174750a1df600a45e8b6c5277107a5dd.tar.bz2
portage-6bffa0c9174750a1df600a45e8b6c5277107a5dd.zip
Move clean code, from the previous commit, from doebuild() to
EbuildBuild.execute() where it fits better. svn path=/main/trunk/; revision=10843
-rw-r--r--pym/_emerge/__init__.py9
-rw-r--r--pym/portage/__init__.py16
2 files changed, 11 insertions, 14 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index c88d8af8f..4929288f3 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1538,12 +1538,17 @@ class EbuildBuild(Task):
def execute(self):
root_config = self.pkg.root_config
portdb = root_config.trees["porttree"].dbapi
- vartree = root_config.trees["vartree"]
ebuild_path = portdb.findname(self.pkg.cpv)
debug = self.settings.get("PORTAGE_DEBUG") == "1"
+ retval = portage.doebuild(ebuild_path, "clean",
+ root_config.root, self.settings, debug, cleanup=1,
+ mydbapi=portdb, tree="porttree")
+ if retval != os.EX_OK:
+ return retval
+
retval = portage.doebuild(ebuild_path, "install",
- root_config.root, self.settings, debug, vartree=vartree,
+ root_config.root, self.settings, debug,
mydbapi=portdb, tree="porttree")
return retval
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 6bdf03a78..9fd08e88e 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4934,18 +4934,10 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
use_cache, mydbapi)
clean_phases = ("clean", "cleanrm")
- if mydo in clean_phases or \
- (not noauto and mydo in actionmap_deps and \
- mysettings.get("EMERGE_FROM") == "ebuild"):
- if mydo not in clean_phases:
- mysettings["EBUILD_PHASE"] = "clean"
- try:
- retval = spawn(_shell_quote(ebuild_sh_binary) + " clean",
- mysettings, debug=debug, free=1, logfile=None)
- finally:
- mysettings["EBUILD_PHASE"] = mydo
- if mydo in clean_phases or retval != os.EX_OK:
- return retval
+ if mydo in clean_phases:
+ retval = spawn(_shell_quote(ebuild_sh_binary) + " clean",
+ mysettings, debug=debug, free=1, logfile=None)
+ return retval
# get possible slot information from the deps file
if mydo == "depend":