summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-02 19:43:59 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-02 19:43:59 +0000
commit225de51d6c0b8a44e8750b812ad784e5d5d96caf (patch)
treeb7ec8832445b2eff61045a46bd1eebb176cbe4c9
parent9a5ef0f23953f89b2eec60f0554c94cba355fc28 (diff)
downloadportage-225de51d6c0b8a44e8750b812ad784e5d5d96caf.tar.gz
portage-225de51d6c0b8a44e8750b812ad784e5d5d96caf.tar.bz2
portage-225de51d6c0b8a44e8750b812ad784e5d5d96caf.zip
For bug #173184, handle the CommandNotFound that is produced during uninstallation of prelink.
svn path=/main/trunk/; revision=6332
-rw-r--r--pym/portage/checksum.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
index 77c962526..5a902ab8c 100644
--- a/pym/portage/checksum.py
+++ b/pym/portage/checksum.py
@@ -181,6 +181,7 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0):
@rtype: Tuple
@return: The hash and size of the data
"""
+ global prelink_capable
myfilename = filename[:]
prelink_tmpfile = os.path.join("/", PRIVATE_PATH, "prelink-checksum.tmp." + str(os.getpid()))
mylock = None
@@ -189,10 +190,14 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0):
mylock = portage.locks.lockfile(prelink_tmpfile, wantnewlockfile=1)
# Create non-prelinked temporary file to checksum.
# Files rejected by prelink are summed in place.
- retval = portage.process.spawn([PRELINK_BINARY, "--undo", "-o",
- prelink_tmpfile, filename], fd_pipes={})
- if retval == os.EX_OK:
- myfilename = prelink_tmpfile
+ try:
+ retval = portage.process.spawn([PRELINK_BINARY, "--undo", "-o",
+ prelink_tmpfile, filename], fd_pipes={})
+ if retval == os.EX_OK:
+ myfilename = prelink_tmpfile
+ except portage.exception.CommandNotFound:
+ # This happens during uninstallation of prelink.
+ prelink_capable = False
try:
if hashname not in hashfunc_map:
raise portage.exception.DigestException(hashname + \