From 7a0a0a1dc02487b08f47fef129a29e18f7c226a0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 18 Dec 2011 16:12:57 -0800 Subject: [PATCH] _run_pkg_pretend: doebuild_environment for clean --- pym/_emerge/Scheduler.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 302b905ef..3800b8b1c 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -866,6 +866,20 @@ class Scheduler(PollScheduler): # Clean up the existing build dir, in case pkg_pretend # checks for available space (bug #390711). if existing_buildir: + if x.built: + tree = "bintree" + infloc = os.path.join(build_dir_path, "build-info") + ebuild_path = os.path.join(infloc, x.pf + ".ebuild") + else: + tree = "porttree" + portdb = root_config.trees["porttree"].dbapi + ebuild_path = portdb.findname(x.cpv, myrepo=x.repo) + if ebuild_path is None: + raise AssertionError( + "ebuild not found for '%s'" % x.cpv) + portage.package.ebuild.doebuild.doebuild_environment( + ebuild_path, "clean", settings=settings, + db=self.trees[settings['EROOT']][tree].dbapi) clean_phase = EbuildPhase(background=False, phase='clean', scheduler=sched_iface, settings=settings) current_task = clean_phase -- 2.26.2