diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-21 02:38:39 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-21 02:38:39 +0000 |
commit | 4b627a140461e498a74ca3ff0122ee2881400e8b (patch) | |
tree | 1975b02cc17efce0a6c5d8ae2f12b1714c5e289a /pym/_emerge/visible.py | |
parent | 307678b58c9f3fad5b52fbc3807751f63d20db43 (diff) | |
download | portage-4b627a140461e498a74ca3ff0122ee2881400e8b.tar.gz portage-4b627a140461e498a74ca3ff0122ee2881400e8b.tar.bz2 portage-4b627a140461e498a74ca3ff0122ee2881400e8b.zip |
Optimized the code for bug #288083 and make it handle more cases. Now Packagev2.2_rc51
instances have 'visible' and 'masks' attributes, since this information needs
to be accessed in more places now.
svn path=/main/trunk/; revision=14859
Diffstat (limited to 'pym/_emerge/visible.py')
-rw-r--r-- | pym/_emerge/visible.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/pym/_emerge/visible.py b/pym/_emerge/visible.py deleted file mode 100644 index c50768dfb..000000000 --- a/pym/_emerge/visible.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -import portage - -def visible(pkgsettings, pkg, ignore=None): - """ - Check if a package is visible. This can raise an InvalidDependString - exception if LICENSE is invalid. - TODO: optionally generate a list of masking reasons - @rtype: Boolean - @returns: True if the package is visible, False otherwise. - """ - if not pkg.metadata["SLOT"]: - return False - if not pkg.installed: - if pkg.invalid: - return False - if not pkgsettings._accept_chost(pkg.cpv, pkg.metadata): - return False - eapi = pkg.metadata["EAPI"] - if not portage.eapi_is_supported(eapi): - return False - if not pkg.installed: - if portage._eapi_is_deprecated(eapi): - return False - if pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata): - return False - try: - if pkgsettings._getMissingProperties(pkg.cpv, pkg.metadata): - return False - except portage.exception.InvalidDependString: - return False - if pkgsettings._getMaskAtom(pkg.cpv, pkg.metadata): - return False - if pkgsettings._getProfileMaskAtom(pkg.cpv, pkg.metadata): - return False - try: - if pkgsettings._getMissingLicenses(pkg.cpv, pkg.metadata): - if ignore is None or 'LICENSE' not in ignore: - return False - except portage.exception.InvalidDependString: - return False - return True |