mymd5 = None
try:
mymd5 = portage_checksum.perform_md5(obj, calc_prelink=1)
- except (OSError,IOError), e:
- if e.errno == errno.ENOENT:
- # the file has disappeared between now and our stat call
- writemsg_stdout("--- !obj %s %s\n" % ("obj", obj))
- continue
- else:
- raise e
+ except portage_exception.FileNotFound, e:
+ # the file has disappeared between now and our stat call
+ writemsg_stdout("--- !obj %s %s\n" % ("obj", obj))
+ continue
+
# string.lower is needed because db entries used to be in upper-case. The
# string.lower allows for backwards compatibility.
if mymd5 != string.lower(pkgfiles[objkey][2]):
if retval==0:
#portage_util.writemsg(">>> prelink checksum '"+str(filename)+"'.\n")
myfilename=prelink_tmpfile
-
- myhash, mysize = hash_function(myfilename)
-
+ try:
+ myhash, mysize = hash_function(myfilename)
+ except (OSError, IOError), e:
+ if e.errno == errno.ENOENT:
+ raise portage_exception.FileNotFound(e)
+ else:
+ raise e
if calc_prelink and prelink_capable:
try:
os.unlink(prelink_tmpfile)