From: karltk Date: Mon, 18 Oct 2004 18:58:31 +0000 (-0000) Subject: Improved robustness of MD5 sum checking X-Git-Tag: gentoolkit-0.2.4.3~341 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=966dd1abfc0eb9de7b6753a955c964060128f17d;p=gentoolkit.git Improved robustness of MD5 sum checking svn path=/; revision=161 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 62688ef..4a72ec9 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -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 * equery: fix for bug #67473 (checking md5sums of prelinked binaries) diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index c46abe5..bd7139b 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -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"]: