summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-07 08:04:55 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-07 08:04:55 +0000
commitded1a397f2d0eecbf24caa8d9dbfda843765b5ac (patch)
treea347678edeccb84b28203153bc03222f61fbd105
parent18d8e4fdbd3abe6a3ac7467019a79e98994ef7c0 (diff)
downloadportage-ded1a397f2d0eecbf24caa8d9dbfda843765b5ac.tar.gz
portage-ded1a397f2d0eecbf24caa8d9dbfda843765b5ac.tar.bz2
portage-ded1a397f2d0eecbf24caa8d9dbfda843765b5ac.zip
Fix EbuildFetcher._wait_hook() so it can be called more than once without
throwing an AttributeError. svn path=/main/trunk/; revision=11646
-rw-r--r--pym/_emerge/__init__.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 4e9070612..cffaf5426 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -2278,16 +2278,17 @@ class EbuildFetcher(SpawnProcess):
def _wait_hook(self):
# Collect elog messages that might have been
# created by the pkg_nofetch phase.
- portage.elog.elog_process(self.pkg.cpv, self._build_dir.settings)
- try:
- shutil.rmtree(self._build_dir.settings["PORTAGE_BUILDDIR"])
- except EnvironmentError, e:
- if e.errno != errno.ENOENT:
- raise
- del e
- self._build_dir.unlock()
- self.config_pool.deallocate(self._build_dir.settings)
- self._build_dir = None
+ if self._build_dir is not None:
+ portage.elog.elog_process(self.pkg.cpv, self._build_dir.settings)
+ try:
+ shutil.rmtree(self._build_dir.settings["PORTAGE_BUILDDIR"])
+ except EnvironmentError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ self._build_dir.unlock()
+ self.config_pool.deallocate(self._build_dir.settings)
+ self._build_dir = None
SpawnProcess._wait_hook(self)
class EbuildBuildDir(SlotObject):