summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico2011-12-19 00:12:57 (GMT)
committerZac Medico2011-12-19 00:12:57 (GMT)
commit7a0a0a1dc02487b08f47fef129a29e18f7c226a0 (patch)
treef2150d11fa004bd29067fe9aceb739501cbe44e6
parentaf7d4ecf7e939818df2f2a210a376d91dd41291d (diff)
_run_pkg_pretend: doebuild_environment for clean
-rw-r--r--pym/_emerge/Scheduler.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 302b905..3800b8b 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