diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-06-06 03:03:58 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-06-06 03:03:58 -0700 |
commit | 0f0cbc1f2279f0e46e493c521f1ac4b73ed35e5e (patch) | |
tree | 8e8a51260f6d791e9603389115d56db5f55ff686 | |
parent | 29dc8a7795161bd37e9cfbb5e2b19ee2c34f7a02 (diff) | |
download | portage-0f0cbc1f2279f0e46e493c521f1ac4b73ed35e5e.tar.gz portage-0f0cbc1f2279f0e46e493c521f1ac4b73ed35e5e.tar.bz2 portage-0f0cbc1f2279f0e46e493c521f1ac4b73ed35e5e.zip |
Use Package.UNKNOWN_REPO where appropriate.
-rw-r--r-- | pym/_emerge/PackageArg.py | 5 | ||||
-rw-r--r-- | pym/portage/package/ebuild/_config/KeywordsManager.py | 3 | ||||
-rw-r--r-- | pym/portage/package/ebuild/_config/MaskManager.py | 3 | ||||
-rw-r--r-- | pym/portage/package/ebuild/_config/helper.py | 5 | ||||
-rw-r--r-- | pym/portage/package/ebuild/config.py | 5 | ||||
-rw-r--r-- | pym/portage/package/ebuild/getmaskingstatus.py | 7 |
6 files changed, 18 insertions, 10 deletions
diff --git a/pym/_emerge/PackageArg.py b/pym/_emerge/PackageArg.py index 02ea03495..ebfe4b21b 100644 --- a/pym/_emerge/PackageArg.py +++ b/pym/_emerge/PackageArg.py @@ -1,7 +1,8 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.DependencyArg import DependencyArg +from _emerge.Package import Package import portage from portage._sets.base import InternalPackageSet from portage.dep import _repo_separator @@ -11,7 +12,7 @@ class PackageArg(DependencyArg): DependencyArg.__init__(self, **kwargs) self.package = package atom = "=" + package.cpv - if package.type_name == 'ebuild': + if package.repo != Package.UNKNOWN_REPO: atom += _repo_separator + package.repo self.atom = portage.dep.Atom(atom, allow_repo=True) self.pset = InternalPackageSet(initial_atoms=(self.atom,), diff --git a/pym/portage/package/ebuild/_config/KeywordsManager.py b/pym/portage/package/ebuild/_config/KeywordsManager.py index 51270f2d3..cd225549e 100644 --- a/pym/portage/package/ebuild/_config/KeywordsManager.py +++ b/pym/portage/package/ebuild/_config/KeywordsManager.py @@ -5,6 +5,7 @@ __all__ = ( 'KeywordsManager', ) +from _emerge.Package import Package from portage import os from portage.dep import ExtendedAtomDict, _repo_separator, _slot_separator from portage.localization import _ @@ -76,7 +77,7 @@ class KeywordsManager(object): def getKeywords(self, cpv, slot, keywords, repo): cp = cpv_getkey(cpv) pkg = "".join((cpv, _slot_separator, slot)) - if repo: + if repo and repo != Package.UNKNOWN_REPO: pkg = "".join((pkg, _repo_separator, repo)) keywords = [[x for x in keywords.split() if x != "-*"]] for pkeywords_dict in self._pkeywords_list: diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py index c438eb7da..df93e105d 100644 --- a/pym/portage/package/ebuild/_config/MaskManager.py +++ b/pym/portage/package/ebuild/_config/MaskManager.py @@ -9,6 +9,7 @@ from portage import os from portage.dep import ExtendedAtomDict, match_from_list, _repo_separator, _slot_separator from portage.util import append_repo, grabfile_package, stack_lists from portage.versions import cpv_getkey +from _emerge.Package import Package class MaskManager(object): @@ -134,7 +135,7 @@ class MaskManager(object): mask_atoms = self._pmaskdict.get(cp) if mask_atoms: pkg = "".join((cpv, _slot_separator, slot)) - if repo: + if repo and repo != Package.UNKNOWN_REPO: pkg = "".join((pkg, _repo_separator, repo)) pkg_list = [pkg] for x in mask_atoms: diff --git a/pym/portage/package/ebuild/_config/helper.py b/pym/portage/package/ebuild/_config/helper.py index ca720982f..4f4678187 100644 --- a/pym/portage/package/ebuild/_config/helper.py +++ b/pym/portage/package/ebuild/_config/helper.py @@ -1,10 +1,11 @@ -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ( 'ordered_by_atom_specificity', 'prune_incremental', ) +from _emerge.Package import Package from portage.dep import best_match_to_list, _repo_separator def ordered_by_atom_specificity(cpdict, pkg, repo=None): @@ -23,7 +24,7 @@ def ordered_by_atom_specificity(cpdict, pkg, repo=None): order to achieve desired results (and thus corrupting the ChangeLog like ordering of the file). """ - if repo is not None: + if repo and repo != Package.UNKNOWN_REPO: pkg = pkg + _repo_separator + repo results = [] diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 54ca8b33f..a3a7f8249 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1412,8 +1412,9 @@ class config(object): profile_atoms = self.prevmaskdict.get(cp) if profile_atoms: pkg = "".join((cpv, _slot_separator, metadata["SLOT"])) - if 'repository' in metadata: - pkg = "".join((pkg, _repo_separator, metadata['repository'])) + repo = metadata.get("repository") + if repo and repo != Package.UNKNOWN_REPO: + pkg = "".join((pkg, _repo_separator, repo)) pkg_list = [pkg] for x in profile_atoms: if match_from_list(x, pkg_list): diff --git a/pym/portage/package/ebuild/getmaskingstatus.py b/pym/portage/package/ebuild/getmaskingstatus.py index 82b99d173..5901e5761 100644 --- a/pym/portage/package/ebuild/getmaskingstatus.py +++ b/pym/portage/package/ebuild/getmaskingstatus.py @@ -11,6 +11,7 @@ from portage.dep import match_from_list, _slot_separator, _repo_separator from portage.localization import _ from portage.package.ebuild.config import config from portage.versions import catpkgsplit, cpv_getkey +from _emerge.Package import Package if sys.hexversion >= 0x3000000: basestring = str @@ -104,8 +105,10 @@ def _getmaskingstatus(mycpv, settings, portdb, myrepo=None): matches = False if pkgdict: pkg = "".join((mycpv, _slot_separator, metadata["SLOT"])) - if 'repository' in metadata: - pkg = "".join((pkg, _repo_separator, metadata['repository'])) + if myrepo is None: + myrepo = metadata.get("repository") + if myrepo is not None and myrepo != Package.UNKNOWN_REPO: + pkg = "".join((pkg, _repo_separator, myrepo)) cpv_slot_list = [pkg] for atom, pkgkeywords in pkgdict.items(): if match_from_list(atom, cpv_slot_list): |