Make PackageArg use repo atoms for ebuilds.
authorZac Medico <zmedico@gentoo.org>
Thu, 7 Oct 2010 06:32:01 +0000 (23:32 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 7 Oct 2010 06:32:01 +0000 (23:32 -0700)
pym/_emerge/PackageArg.py

index a169845cc594d1dfbd935c9cf855af9a16049395..02ea0349510d754ce78ddeb149f4e70117da3a91 100644 (file)
@@ -1,13 +1,18 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.DependencyArg import DependencyArg
 import portage
 from portage._sets.base import InternalPackageSet
+from portage.dep import _repo_separator
 
 class PackageArg(DependencyArg):
        def __init__(self, package=None, **kwargs):
                DependencyArg.__init__(self, **kwargs)
                self.package = package
-               self.atom = portage.dep.Atom("=" + package.cpv)
-               self.pset = InternalPackageSet(initial_atoms=(self.atom,))
+               atom = "=" + package.cpv
+               if package.type_name == 'ebuild':
+                       atom += _repo_separator + package.repo
+               self.atom = portage.dep.Atom(atom, allow_repo=True)
+               self.pset = InternalPackageSet(initial_atoms=(self.atom,),
+                       allow_repo=True)