]> git.ipfire.org Git - pakfire.git/commitdiff
Use uuid for fast package comparison.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 26 Feb 2011 00:19:45 +0000 (01:19 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 26 Feb 2011 00:19:45 +0000 (01:19 +0100)
pakfire/packages/base.py

index 6389b63256895d47f94bc31a9aa34f74923bb06c..4bdec60fc2203f85429e176fac8927098e47a23b 100644 (file)
@@ -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.