When using the old binhost protocol, comparison with the remote
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:49:20 +0000 (21:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:49:20 +0000 (21:49 -0000)
package isn't supported, so the local package is always preferred
even if --getbinpkgonly is enabled. Simplify bintree.isremote()
so it works the same way regardless of which protocol is used. (trunk r12209)

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

pym/portage/dbapi/bintree.py

index 7c6cd5980a7f766f37bbb79487e62526ed52af9f..1e9f9aeebec45d078f297071bf1a96b7bb71b2e6 100644 (file)
@@ -741,8 +741,10 @@ class binarytree(object):
                                mycat = self.remotepkgs[mypkg]["CATEGORY"].strip()
                                fullpkg = mycat+"/"+mypkg[:-5]
 
-                               if not getbinpkgsonly and fullpkg in metadata:
-                                       # Local package overrides the remote one.
+                               if fullpkg in metadata:
+                                       # When using this old protocol, comparison with the remote
+                                       # package isn't supported, so the local package is always
+                                       # preferred even if getbinpkgsonly is enabled.
                                        continue
 
                                if not self.dbapi._category_re.match(mycat):
@@ -1011,14 +1013,8 @@ class binarytree(object):
                downloaded (or it is only partially downloaded)."""
                if self._remotepkgs is None or pkgname not in self._remotepkgs:
                        return False
-               if self._remote_has_index:
-                       # Presence in self._remotepkgs implies that it's remote. When a
-                       # package is downloaded, state is updated by self.inject().
-                       return True
-               pkg_path = self.getname(pkgname)
-               if os.path.exists(pkg_path) and \
-                       os.path.basename(pkg_path) not in self.invalids:
-                       return False
+               # Presence in self._remotepkgs implies that it's remote. When a
+               # package is downloaded, state is updated by self.inject().
                return True
 
        def get_use(self, pkgname):