summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-02 19:44:25 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-02 19:44:25 +0000
commit84bcb16174a9f74d5a25649e57ccb9baa0bd9d8d (patch)
treee134b9d111bf5761b313c93698b14e98578ecbab
parentFix missing import. (trunk r6324:6325) (diff)
downloadportage-multirepo-84bcb16174a9f74d5a25649e57ccb9baa0bd9d8d.tar.gz
portage-multirepo-84bcb16174a9f74d5a25649e57ccb9baa0bd9d8d.tar.bz2
portage-multirepo-84bcb16174a9f74d5a25649e57ccb9baa0bd9d8d.zip
For bug #173184, handle the CommandNotFound that is produced during uninstallation of prelink. (trunk r6331:6332)
svn path=/main/branches/2.1.2/; revision=6333
-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 cd5e0cb3..885535ee 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_exec.spawn([PRELINK_BINARY, "--undo", "-o",
- prelink_tmpfile, filename], fd_pipes={})
- if retval == os.EX_OK:
- myfilename = prelink_tmpfile
+ try:
+ retval = portage_exec.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 + \