From: Zac Medico Date: Sat, 27 Sep 2008 19:24:10 +0000 (-0000) Subject: Mask packages with deprecated EAPIs in order to prevent them from being X-Git-Tag: v2.2_rc12~75 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5e168263d76aabbfc2df79e048d0ced37bebcd66;p=portage.git Mask packages with deprecated EAPIs in order to prevent them from being installed. Such packages will still behave normally if they are already installed, but preventing new installation will remind people to update the EAPIs in their overlays if necessary. svn path=/main/trunk/; revision=11573 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 4926f042d..eb6b855b8 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1245,11 +1245,14 @@ def visible(pkgsettings, pkg): if pkg.built and not pkg.installed and "CHOST" in pkg.metadata: if not pkgsettings._accept_chost(pkg): return False - if not portage.eapi_is_supported(pkg.metadata["EAPI"]): - return False - if not pkg.installed and \ - pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata): + 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 if pkgsettings._getMaskAtom(pkg.cpv, pkg.metadata): return False if pkgsettings._getProfileMaskAtom(pkg.cpv, pkg.metadata): diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index cfeb8942e..2a596fa86 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -4578,10 +4578,15 @@ def _spawn_misc_sh(mysettings, commands, **kwargs): eerror(l, phase=mydo, key=mysettings.mycpv) return rval +_deprecated_eapis = frozenset(["2_pre3", "2_pre2", "2_pre1"]) + +def _eapi_is_deprecated(eapi): + return eapi in _deprecated_eapis + def eapi_is_supported(eapi): eapi = str(eapi).strip() - if eapi in ("2_pre3", "2_pre2", "2_pre1"): + if _eapi_is_deprecated(eapi): return True try: @@ -6758,6 +6763,8 @@ def getmaskingstatus(mycpv, settings=None, portdb=None): eapi = eapi[1:] if not eapi_is_supported(eapi): return ["EAPI %s" % eapi] + elif _eapi_is_deprecated(eapi) and not installed: + return ["EAPI %s" % eapi] egroups = settings.configdict["backupenv"].get( "ACCEPT_KEYWORDS", "").split() mygroups = mygroups.split() diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 8d3700741..41ca19c85 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -20,7 +20,8 @@ from portage.versions import pkgsplit, catpkgsplit, best, ver_regexp import portage.gpg, portage.checksum from portage import eclass_cache, auxdbkeys, doebuild, flatten, \ - listdir, dep_expand, eapi_is_supported, key_expand, dep_check + listdir, dep_expand, eapi_is_supported, key_expand, dep_check, \ + _eapi_is_deprecated import os, stat from itertools import izip @@ -917,7 +918,10 @@ class portdbapi(dbapi): writemsg("!!! %s\n" % str(e), noiselevel=-1) del e continue - if not eapi_is_supported(metadata["EAPI"]): + eapi = metadata["EAPI"] + if not eapi_is_supported(eapi): + continue + if _eapi_is_deprecated(eapi): continue if self.mysettings._getMissingKeywords(mycpv, metadata): continue