Improved robustness of MD5 sum checking
authorkarltk <karltk@gentoo.org>
Mon, 18 Oct 2004 18:58:31 +0000 (18:58 -0000)
committerkarltk <karltk@gentoo.org>
Mon, 18 Oct 2004 18:58:31 +0000 (18:58 -0000)
svn path=/; revision=161

trunk/ChangeLog
trunk/src/equery/equery

index 62688ef7129eb9d273ba47f0dd80d3c2ade86655..4a72ec970a0b41c3640924df2f156afa24276296 100644 (file)
@@ -6,6 +6,8 @@
        * equery: minor syntactical cleanups.
        * equery: minor documentation improvements
        * equery: added errors module that will hold various types of internal errors raised.
+       * equery: added try block around on md5sum check, which fails on various conditions like
+                               insufficient permission or stale temporary checksum files.
        
 2004-10-17 Marius Mauch <genone@gentoo.org>
        * equery: fix for bug #67473 (checking md5sums of prelinked binaries)
index c46abe568eff29bdb172b5f298d5c33553539b2e..bd7139b3a3c00adfd6bd384a4d1caa96ffc1c030 100755 (executable)
@@ -822,6 +822,11 @@ class CmdCheckIntegrity(Command):
                                                mtime = files[file][1]
                                                md5sum = files[file][2]
                                                if opts["checkMD5sum"]:
+                                                       try: 
+                                                               actual_checksum = self.getMD5sum(file)
+                                                       except:
+                                                               raise CheckException("Failed to calculate MD5 sum for " + file)
+                                                               
                                                        if self.getMD5sum(file) != md5sum:
                                                                raise CheckException(file + " has incorrect md5sum")
                                                if opts["checkTimestamp"]: