Discard metadata from the Packages file if there's no MTIME attribute.
authorZac Medico <zmedico@gentoo.org>
Tue, 22 May 2007 22:45:21 +0000 (22:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 22 May 2007 22:45:21 +0000 (22:45 -0000)
svn path=/main/trunk/; revision=6585

pym/portage/dbapi/bintree.py

index 5ec32d252bfc7e191206b2d66578be47efc3375b..6e0800b08977b28f1d03a8bea016a1ff58e7a20f 100644 (file)
@@ -456,17 +456,11 @@ class binarytree(object):
                                        update_pkgindex = True
                                        d = metadata.get(mycpv, {})
                                        if d:
-                                               # Reuse metadata such as MD5, since we won't calculate
-                                               # MD5 here due to the performance hit.
-                                               mtime = d.get("MTIME")
-                                               if mtime:
-                                                       # genpgkindex really should include the mtime and
-                                                       # then this mtime check should be forced.
-                                                       try:
-                                                               if long(mtime) != long(s.st_mtime):
-                                                                       d.clear()
-                                                       except ValueError:
+                                               try:
+                                                       if long(d["MTIME"]) != long(s.st_mtime):
                                                                d.clear()
+                                               except (KeyError, ValueError):
+                                                       d.clear()
                                        if d:
                                                try:
                                                        if long(d["SIZE"]) != long(s.st_size):