Mask packages with deprecated EAPIs in order to prevent them from being
authorZac Medico <zmedico@gentoo.org>
Sat, 27 Sep 2008 19:24:10 +0000 (19:24 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 27 Sep 2008 19:24:10 +0000 (19:24 -0000)
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

pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index 4926f042d1b310b6ce76e395ba57890f8b8f052d..eb6b855b8228c85e842d7d36ae6877e4a1a7094e 100644 (file)
@@ -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):
index cfeb8942e0e1c97ab3be522fd4d7c4911fd58540..2a596fa86f64208317a5ae4612f034f0f7ebce4f 100644 (file)
@@ -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()
index 8d37007416e138dac8031e50c59fd097b5194ee9..41ca19c856732e9ebd7975a69c84c5c722fd8cb4 100644 (file)
@@ -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