summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-20 04:00:24 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-20 04:00:24 +0000
commitdcb33edbdf01256d2f2cb3f40cf0fa7ecbb0f470 (patch)
treeb18a9295306138ecff3c436ae4323c63bceae647
parent4a497e4bc5232d8ecc19f60f6e80faf38544aab0 (diff)
downloadportage-dcb33edbdf01256d2f2cb3f40cf0fa7ecbb0f470.tar.gz
portage-dcb33edbdf01256d2f2cb3f40cf0fa7ecbb0f470.tar.bz2
portage-dcb33edbdf01256d2f2cb3f40cf0fa7ecbb0f470.zip
Bug #202748 - When merging a binary package, only clean up
temp files on success. Otherwise, leave the temp files intact for debugging purposes. svn path=/main/trunk/; revision=8971
-rw-r--r--pym/portage/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 0894dac0c..1c9956336 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5802,6 +5802,7 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes
mycat = None
mypkg = None
did_merge_phase = False
+ success = False
try:
""" Don't lock the tbz2 file because the filesytem could be readonly or
shared by a cluster."""
@@ -5879,6 +5880,7 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes
retval = mylink.merge(pkgloc, infloc, myroot, myebuild, cleanup=0,
mydbapi=mydbapi, prev_mtimes=prev_mtimes)
did_merge_phase = True
+ success = retval == os.EX_OK
return retval
finally:
mysettings.pop("PORTAGE_BINPKG_FILE", None)
@@ -5892,7 +5894,8 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes
from portage.elog import elog_process
elog_process(mycat + "/" + mypkg, mysettings)
try:
- shutil.rmtree(builddir)
+ if success:
+ shutil.rmtree(builddir)
except (IOError, OSError), e:
if e.errno != errno.ENOENT:
raise