From 30e520c88365198279aa8516a6a40d413f4a7795 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 28 Sep 2008 11:08:30 +0000 Subject: [PATCH] Merged from trunk -r11572:11576 | 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 | 8 +++----- pym/_emerge/__init__.py | 17 ++++++++++------- pym/portage/__init__.py | 9 ++++++++- pym/portage/dbapi/porttree.py | 8 ++++++-- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index fe6fb10ae..6e9a53109 100644 --- 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 diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 947954967..0b404e712 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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: diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 51a8cb668..175f00e8f 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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() 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 -- 2.26.2