Fix old-style binhost code binarytree.digestCheck() will use local digests when
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:48:56 +0000 (21:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:48:56 +0000 (21:48 -0000)
a local package overrides a remote one. (trunk r12208)

svn path=/main/branches/2.1.6/; revision=12239

pym/portage/dbapi/bintree.py

index 0fa2db06af30bcd134bcf58a74767a26714961c7..7c6cd5980a7f766f37bbb79487e62526ed52af9f 100644 (file)
@@ -740,6 +740,11 @@ class binarytree(object):
                                        continue
                                mycat = self.remotepkgs[mypkg]["CATEGORY"].strip()
                                fullpkg = mycat+"/"+mypkg[:-5]
+
+                               if not getbinpkgsonly and fullpkg in metadata:
+                                       # Local package overrides the remote one.
+                                       continue
+
                                if not self.dbapi._category_re.match(mycat):
                                        writemsg(("!!! Remote binary package has an " + \
                                                "unrecognized category: '%s'\n") % fullpkg,
@@ -754,10 +759,10 @@ class binarytree(object):
                                        # invalid tbz2's can hurt things.
                                        #print "cpv_inject("+str(fullpkg)+")"
                                        self.dbapi.cpv_inject(fullpkg)
-                                       metadata = self.remotepkgs[mypkg]
-                                       for k, v in metadata.items():
-                                               metadata[k] = v.strip()
-                                       self._remotepkgs[fullpkg] = metadata
+                                       remote_metadata = self.remotepkgs[mypkg]
+                                       for k, v in remote_metadata.items():
+                                               remote_metadata[k] = v.strip()
+                                       self._remotepkgs[fullpkg] = remote_metadata
                                        #print "  -- Injected"
                                except SystemExit, e:
                                        raise