Merged from trunk -r11572:11576
authorFabian Groffen <grobian@gentoo.org>
Sun, 28 Sep 2008 11:08:30 +0000 (11:08 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 28 Sep 2008 11:08:30 +0000 (11:08 -0000)
   | 11573   | Mask packages with deprecated EAPIs in order to prevent them |
   | zmedico | 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.                                       |

   | 11574   | EAPI 2 is now supported.                                     |
   | zmedico |                                                              |

   | 11575   | Fix code inside BlockerDB.findInstalledBlockers() to         |
   | zmedico | correctly strip multiple "!" characters when necessary. The  |
   |         | code seemed to work fine anyway so this is more a            |
   |         | correctness fix than a bug fix.                              |

   | 11576   | Another correctness fix in                                   |
   | zmedico | BlockerDB.findInstalledBlockers().                           |

svn path=/main/branches/prefix/; revision=11578

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

diff --git a/NEWS b/NEWS
index fe6fb10ae5bea8df10c05c54bbc846e66478b704..6e9a531094ed739b97230b05849f17d47d35b2ef 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,11 +3,9 @@ News (mainly features/major bug fixes)
 portage-2.2
 -------------
 
-* Add support for a new EAPI="2_pre0" value that can be used in ebuilds when
-  testing new features such as USE dependencies. This is an experimental EAPI
-  that will not be supported after the final EAPI 2 is defined. For more
-  information about experimental EAPI features, refer to the "Ebuild" chapter
-  of the html documentation that is installed with portage.
+* Add support for a new EAPI="2" value. For more information about new EAPI
+  features, refer to the "Ebuild" chapter of the html documentation that is
+  installed with portage.
 * Add PORTAGE_IONICE_COMMAND setting for make.conf which is called to adjust
   IO priority on portage and it's subprocesses.
 * Add link level dependency awareness to emerge --depclean and --prune actions
index 947954967647b1d156a45056677cd76c5889aaa2..0b404e712a62b9fc0e79da2abb31c65bab226d44 100644 (file)
@@ -1266,11 +1266,14 @@ def visible(pkgsettings, pkg):
                        return False
                if len(pkg.metadata["EPREFIX"].strip()) < len(pkgsettings["EPREFIX"]):
                        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):
@@ -3886,7 +3889,7 @@ class BlockerDB(object):
                blocker_atoms = []
                for pkg in installed_pkgs:
                        for blocker_atom in blocker_cache[pkg.cpv].atoms:
-                               blocker_atom = blocker_atom[1:]
+                               blocker_atom = blocker_atom.lstrip("!")
                                blocker_atoms.append(blocker_atom)
                                blocker_parents.add(blocker_atom, pkg)
 
@@ -3909,8 +3912,8 @@ class BlockerDB(object):
                        show_invalid_depstring_notice(new_pkg, depstr, atoms)
                        assert False
 
-               blocker_atoms = [atom[1:] for atom in atoms \
-                       if atom.startswith("!")]
+               blocker_atoms = [atom.lstrip("!") for atom in atoms \
+                       if atom[:1] == "!"]
                if blocker_atoms:
                        blocker_atoms = InternalPackageSet(initial_atoms=blocker_atoms)
                        for inst_pkg in installed_pkgs:
index 51a8cb668971a3ea2cde6ff154dc129140dd6774..175f00e8f7f5866212cb470bab73d5283709c3e3 100644 (file)
@@ -4598,6 +4598,11 @@ 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):
        # PREFIX HACK/EXTENSION: in prefix we have "incompatible" ebuilds in
        # an consistent manner; regardless what the EAPI of the main tree
@@ -4627,7 +4632,7 @@ def eapi_is_supported(eapi):
                        eapi.remove(prop)
        
        # now check if what's left is supported (can)
-       properties = [ "2_pre3", "2_pre2", "2_pre1" ] # another clumpsy solution
+       properties = _deprecated_eapis[:] # another clumpsy solution
        for i in range(portage.const.EAPI + 1):
                properties.append(str(i))
 
@@ -6806,6 +6811,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