summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-15 23:10:43 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-15 23:10:43 +0000
commit1135dc0eb64614edd36b62849aee9ccfc6829613 (patch)
tree2e5c0459b8f50e6b9dc13b42ea7c28867ae39997 /pym
parent2f7623de3fd05f3be34ccd18d6f06c4fb1144c4a (diff)
downloadportage-1135dc0eb64614edd36b62849aee9ccfc6829613.tar.gz
portage-1135dc0eb64614edd36b62849aee9ccfc6829613.tar.bz2
portage-1135dc0eb64614edd36b62849aee9ccfc6829613.zip
Only attempt to unmerge the already-installed instance if it actually exists. This patch prevents self.settings.configdict["pkg"] from getting nuked by a call to load_infodir on a nonexistent directory. By preserving configdict["pkg"] here, the CATEGORY is available for the next doebuild call (needed to create log names correctly).
svn path=/main/trunk/; revision=3514
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 486ee8ddf..b1c1cd9a2 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6342,11 +6342,12 @@ class dblink:
outfile.flush()
outfile.close()
- writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
- self.dbdir = self.dbpkgdir
- self.unmerge(oldcontents,trimworld=0)
- self.dbdir = self.dbtmpdir
- writemsg_stdout(">>> Original instance of package unmerged safely.\n")
+ if os.path.exists(self.dbpkgdir):
+ writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
+ self.dbdir = self.dbpkgdir
+ self.unmerge(oldcontents,trimworld=0)
+ self.dbdir = self.dbtmpdir
+ writemsg_stdout(">>> Original instance of package unmerged safely.\n")
# We hold both directory locks.
self.dbdir = self.dbpkgdir