From: Michael Tremer Date: Sat, 26 Feb 2011 00:19:45 +0000 (+0100) Subject: Use uuid for fast package comparison. X-Git-Tag: 0.9.3~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0026f80b8be5212683902550c942d4cd4253535b;p=pakfire.git Use uuid for fast package comparison. --- diff --git a/pakfire/packages/base.py b/pakfire/packages/base.py index 6389b6325..4bdec60fc 100644 --- a/pakfire/packages/base.py +++ b/pakfire/packages/base.py @@ -23,6 +23,10 @@ class Package(object): if not self.name == other.name: return cmp(self.name, other.name) + # Compare the uuids: if packages have the same id they are totally equal. + if self.uuid and self.uuid == other.uuid: + return 0 + ret = util.version_compare(self.version_tuple, other.version_tuple) # Compare the build times if we have a rebuilt package.