From: Fabian Groffen Date: Fri, 27 Mar 2009 11:43:55 +0000 (-0000) Subject: Remove EAPIPREFIX, remain backwards compatible for now by still accepting 'prefix... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1caf0265721e1a696824c8d93e606a525d8707fc;p=portage.git Remove EAPIPREFIX, remain backwards compatible for now by still accepting 'prefix' in EAPI, but not caring about it much. Prefix masking is done solely by our (for this reason) different keywords svn path=/main/branches/prefix/; revision=13234 --- diff --git a/configure.in b/configure.in index 0ffb90b24..ca463bc64 100644 --- a/configure.in +++ b/configure.in @@ -208,10 +208,8 @@ AC_HELP_STRING([--with-offset-prefix], if test "x$DOMAIN_PREFIX" = "x" then PORTAGE_EPREFIX='""' - EAPIPREFIX='None' else PORTAGE_EPREFIX='path.normpath("'"$DOMAIN_PREFIX"'")' - EAPIPREFIX='"prefix"' fi DEFAULT_PATH="${DOMAIN_PREFIX}/usr/bin:${DOMAIN_PREFIX}/usr/sbin:${DOMAIN_PREFIX}/bin:${DOMAIN_PREFIX}/sbin:${prefix}/bin" @@ -236,7 +234,6 @@ AC_SUBST(rootuid) AC_SUBST(rootgid) AC_SUBST(DOMAIN_PREFIX) AC_SUBST(PORTAGE_EPREFIX) -AC_SUBST(EAPIPREFIX) AC_SUBST(DEFAULT_PATH) AC_SUBST(PORTAGE_BASE,['${exec_prefix}/lib/portage']) AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index ee28e11e0..1d2c95e6e 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -63,7 +63,7 @@ portage.dep._dep_check_strict = True import portage.util import portage.locks import portage.exception -from portage.const import EPREFIX, BPREFIX, EPREFIX_LSTRIP, EAPIPREFIX +from portage.const import EPREFIX, BPREFIX, EPREFIX_LSTRIP from portage.data import secpass from portage.elog.messages import eerror from portage.util import normalize_path as normpath @@ -3032,7 +3032,7 @@ class EbuildExecuter(CompositeTask): pkg = self.pkg phases = self._phases - eapi = pkg.metadata["EAPI"].replace(EAPIPREFIX, "").strip() + eapi = pkg.metadata["EAPI"].replace("prefix", "").strip() if eapi in ("0", "1"): # skip src_prepare and src_configure phases = phases[2:] @@ -6090,15 +6090,10 @@ class depgraph(object): print "!!! One of the following masked packages is required to complete your request:" have_eapi_mask = show_masked_packages(masked_packages) if have_eapi_mask: - if portage.const.EAPIPREFIX: - p = portage.const.EAPIPREFIX + " " - else: - p = '' - print msg = ("The current version of portage supports " + \ - "EAPI '%s%s'. You must upgrade to a newer version" + \ + "EAPI '%s'. You must upgrade to a newer version" + \ " of portage before EAPI masked packages can" + \ - " be installed.") % (p, portage.const.EAPI) + " be installed.") % (portage.const.EAPI) from textwrap import wrap for line in wrap(msg, 75): print line diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index bc512cebc..711f0b256 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5062,21 +5062,11 @@ def eapi_is_supported(eapi): # However, back to reality, we just look for all we require, # and don't do version tricks other than the main tree does. - eapi = str(eapi).split() # note Python's contact for this special case + eapi = str(eapi).split() # note Python's contract for this special case - # these are the properties that MUST be present (should) - properties = set() - if portage.const.EAPIPREFIX: - properties.add(portage.const.EAPIPREFIX) # clumpsy temporary solution - - for prop in properties: - if prop not in eapi: - return False - else: - eapi.remove(prop) - - # now check if what's left is supported (can) + # check what's supported (can) properties = set(_testing_eapis) # another clumpsy solution + properties.add("prefix") # clumpsy temporary solution for i in range(portage.const.EAPI + 1): properties.add(str(i)) diff --git a/pym/portage/const.py b/pym/portage/const.py index 01f67d92d..40faf7f35 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -14,8 +14,6 @@ BPREFIX = EPREFIX # pick up EPREFIX from the environment if set if "EPREFIX" in os.environ: EPREFIX = os.path.normpath(os.environ["EPREFIX"]) -if "EAPIPREFIX" in os.environ: - EAPIPREFIX = os.environ["EAPIPREFIX"] # =========================================================================== # START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF diff --git a/pym/portage/const_autotool.py b/pym/portage/const_autotool.py index 8a5c5e9ac..04a91bbf8 100644 --- a/pym/portage/const_autotool.py +++ b/pym/portage/const_autotool.py @@ -1,15 +1,14 @@ -# Copyright: 2005-2007 Gentoo Foundation +# Copyright: 2005-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ # all vars that are to wind up in portage_const must have their name listed in __all__ -__all__ = ["EAPIPREFIX", "EPREFIX", "SYSCONFDIR", "DATADIR", "PORTAGE_BASE", +__all__ = ["EPREFIX", "SYSCONFDIR", "DATADIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid", "rootgid"] from os import path -EAPIPREFIX = @EAPIPREFIX@ EPREFIX = @PORTAGE_EPREFIX@ SYSCONFDIR = path.normpath("@sysconfdir@") DATADIR = path.normpath("@datadir@") diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index f97c2f9bc..5009fc875 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -17,7 +17,7 @@ from portage.cache.mappings import slot_dict_class from portage.dbapi.virtual import fakedbapi from portage.exception import InvalidPackageName, \ PermissionDenied, PortageException -from portage.const import EAPI, EAPIPREFIX +from portage.const import EAPI from portage import dep_expand, listdir, _check_distfile, _movefile @@ -170,13 +170,9 @@ class binarytree(object): self._pkgindex_header_keys = set(["ACCEPT_KEYWORDS", "CBUILD", "CHOST", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "FEATURES", "GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE", "EAPI", "EPREFIX"]) - if EAPIPREFIX: - eapi = EAPIPREFIX + " " + str(EAPI) - else: - eapi = str(EAPI) self._pkgindex_default_pkg_data = { "DEPEND" : "", - "EAPI" : eapi, + "EAPI" : "0", "IUSE" : "", "KEYWORDS": "", "LICENSE" : "",