From: Zac Medico Date: Sun, 29 Jun 2008 04:27:57 +0000 (-0000) Subject: Move clean code, from the previous commit, from doebuild() to X-Git-Tag: v2.2_rc2~282 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6bffa0c9174750a1df600a45e8b6c5277107a5dd;p=portage.git Move clean code, from the previous commit, from doebuild() to EbuildBuild.execute() where it fits better. svn path=/main/trunk/; revision=10843 --- 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":