* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/dep/, pym/portage/package/ebuild/, pym/portage/, ...
@ 2018-03-17 21:43 Michał Górny
0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2018-03-17 21:43 UTC (permalink / raw
To: gentoo-commits
commit: 02df0addf8f8477590176807d747b4cbb57b7c32
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 16 08:30:41 2018 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar 17 21:43:03 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=02df0add
Support BDEPEND (CBUILD dependencies) in EAPI 7
Bug: https://bugs.gentoo.org/317337
Closes: https://github.com/gentoo/portage/pull/268
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
bin/eapi.sh | 4 +++
bin/ebuild.sh | 29 ++++++++++++++++------
bin/phase-functions.sh | 2 +-
pym/_emerge/Package.py | 5 ++--
pym/_emerge/actions.py | 1 +
pym/_emerge/depgraph.py | 10 +++++++-
pym/portage/__init__.py | 2 +-
pym/portage/cache/metadata.py | 2 +-
pym/portage/dbapi/bintree.py | 7 +++---
pym/portage/dbapi/porttree.py | 2 +-
pym/portage/dbapi/vartree.py | 4 +--
pym/portage/dep/_slot_operator.py | 7 ++++--
pym/portage/eapi.py | 7 +++++-
.../package/ebuild/_config/special_env_vars.py | 3 ++-
pym/portage/package/ebuild/config.py | 2 +-
15 files changed, 62 insertions(+), 25 deletions(-)
diff --git a/bin/eapi.sh b/bin/eapi.sh
index 665b6f13e..326eb387e 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -34,6 +34,10 @@ ___eapi_has_HDEPEND() {
[[ ${1-${EAPI-0}} =~ ^(5-hdepend)$ ]]
}
+___eapi_has_BDEPEND() {
+ [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
+}
+
___eapi_has_RDEPEND_DEPEND_fallback() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
}
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 9995a2f99..061b1aff4 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -264,6 +264,7 @@ inherit() {
local B_RDEPEND
local B_PDEPEND
local B_HDEPEND
+ local B_BDEPEND
while [ "$1" ]; do
location=""
potential_location=""
@@ -307,14 +308,17 @@ inherit() {
set -f
# Retain the old data and restore it later.
- unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND B_HDEPEND
+ unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND
+ unset B_HDEPEND B_BDEPEND
[ "${IUSE+set}" = set ] && B_IUSE="${IUSE}"
[ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
[ "${DEPEND+set}" = set ] && B_DEPEND="${DEPEND}"
[ "${RDEPEND+set}" = set ] && B_RDEPEND="${RDEPEND}"
[ "${PDEPEND+set}" = set ] && B_PDEPEND="${PDEPEND}"
[ "${HDEPEND+set}" = set ] && B_HDEPEND="${HDEPEND}"
+ [ "${BDEPEND+set}" = set ] && B_BDEPEND="${BDEPEND}"
unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND HDEPEND
+ unset BDEPEND
#turn on glob expansion
set +f
fi
@@ -333,6 +337,7 @@ inherit() {
[ "${RDEPEND+set}" = set ] && E_RDEPEND+="${E_RDEPEND:+ }${RDEPEND}"
[ "${PDEPEND+set}" = set ] && E_PDEPEND+="${E_PDEPEND:+ }${PDEPEND}"
[ "${HDEPEND+set}" = set ] && E_HDEPEND+="${E_HDEPEND:+ }${HDEPEND}"
+ [ "${BDEPEND+set}" = set ] && E_BDEPEND+="${E_BDEPEND:+ }${BDEPEND}"
[ "${B_IUSE+set}" = set ] && IUSE="${B_IUSE}"
[ "${B_IUSE+set}" = set ] || unset IUSE
@@ -352,6 +357,9 @@ inherit() {
[ "${B_HDEPEND+set}" = set ] && HDEPEND="${B_HDEPEND}"
[ "${B_HDEPEND+set}" = set ] || unset HDEPEND
+ [ "${B_BDEPEND+set}" = set ] && BDEPEND="${B_BDEPEND}"
+ [ "${B_BDEPEND+set}" = set ] || unset BDEPEND
+
#turn on glob expansion
set +f
@@ -618,9 +626,10 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
# In order to ensure correct interaction between ebuilds and
# eclasses, they need to be unset before this process of
# interaction begins.
- unset EAPI DEPEND RDEPEND PDEPEND HDEPEND INHERITED IUSE REQUIRED_USE \
- ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND \
- E_HDEPEND PROVIDES_EXCLUDE REQUIRES_EXCLUDE
+ unset EAPI DEPEND RDEPEND PDEPEND HDEPEND BDEPEND
+ unset INHERITED IUSE REQUIRED_USE ECLASS E_IUSE E_REQUIRED_USE
+ unset E_DEPEND E_RDEPEND E_PDEPEND E_HDEPEND E_BDEPEND
+ unset PROVIDES_EXCLUDE REQUIRES_EXCLUDE
if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
source "$EBUILD" || die "error sourcing ebuild"
@@ -656,10 +665,11 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
RDEPEND+="${RDEPEND:+ }${E_RDEPEND}"
PDEPEND+="${PDEPEND:+ }${E_PDEPEND}"
HDEPEND+="${HDEPEND:+ }${E_HDEPEND}"
+ BDEPEND+="${BDEPEND:+ }${E_BDEPEND}"
REQUIRED_USE+="${REQUIRED_USE:+ }${E_REQUIRED_USE}"
- unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND E_HDEPEND \
- __INHERITED_QA_CACHE
+ unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
+ unset E_HDEPEND E_BDEPEND __INHERITED_QA_CACHE
# alphabetically ordered by $EBUILD_PHASE value
case ${EAPI} in
@@ -728,13 +738,16 @@ if [[ $EBUILD_PHASE = depend ]] ; then
fi
auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
- DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND UNUSED_05 EAPI
- PROPERTIES DEFINED_PHASES HDEPEND UNUSED_04
+ DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND BDEPEND
+ EAPI PROPERTIES DEFINED_PHASES HDEPEND UNUSED_04
UNUSED_03 UNUSED_02 UNUSED_01"
if ! ___eapi_has_HDEPEND; then
unset HDEPEND
fi
+ if ! ___eapi_has_BDEPEND; then
+ unset BDEPEND
+ fi
# The extra $(echo) commands remove newlines.
if [ -n "${dbkey}" ] ; then
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 6ae61b2f0..3aae3ef56 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -7,7 +7,7 @@
# of ebuild.sh will work for pkg_postinst, pkg_prerm, and pkg_postrm
# when portage is upgrading itself.
-PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
+PORTAGE_READONLY_METADATA="BDEPEND DEFINED_PHASES DEPEND DESCRIPTION
EAPI HDEPEND HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
PDEPEND RDEPEND REPOSITORY RESTRICT SLOT SRC_URI"
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index b7911c5f4..791a35612 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -42,6 +42,7 @@ class Package(Task):
"_validated_atoms", "_visible")
metadata_keys = [
+ "BDEPEND",
"BUILD_ID", "BUILD_TIME", "CHOST", "COUNTER", "DEFINED_PHASES",
"DEPEND", "EAPI", "HDEPEND", "INHERITED", "IUSE", "KEYWORDS",
"LICENSE", "MD5", "PDEPEND", "PROVIDES",
@@ -49,8 +50,8 @@ class Package(Task):
"PROPERTIES", "REQUIRES", "RESTRICT", "SIZE",
"SLOT", "USE", "_mtime_"]
- _dep_keys = ('DEPEND', 'HDEPEND', 'PDEPEND', 'RDEPEND')
- _buildtime_keys = ('DEPEND', 'HDEPEND')
+ _dep_keys = ('BDEPEND', 'DEPEND', 'HDEPEND', 'PDEPEND', 'RDEPEND')
+ _buildtime_keys = ('BDEPEND', 'DEPEND', 'HDEPEND')
_runtime_keys = ('PDEPEND', 'RDEPEND')
_use_conditional_misc_keys = ('LICENSE', 'PROPERTIES', 'RESTRICT')
UNKNOWN_REPO = _unknown_repo
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 455aa7e04..1d4e66def 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1322,6 +1322,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
priority_map = {
"RDEPEND": runtime,
"PDEPEND": runtime_post,
+ "BDEPEND": buildtime,
"HDEPEND": buildtime,
"DEPEND": buildtime,
}
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 747ef1a1a..5c863103e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3289,16 +3289,18 @@ class depgraph(object):
# Removal actions never traverse ignored buildtime
# dependencies, so it's safe to discard them early.
edepend["DEPEND"] = ""
+ edepend["BDEPEND"] = ""
edepend["HDEPEND"] = ""
ignore_build_time_deps = True
ignore_depend_deps = ignore_build_time_deps
+ ignore_bdepend_deps = ignore_build_time_deps
ignore_hdepend_deps = ignore_build_time_deps
if removal_action:
depend_root = myroot
else:
- if eapi_attrs.hdepend:
+ if eapi_attrs.bdepend or eapi_attrs.hdepend:
depend_root = myroot
else:
depend_root = self._frozen_config._running_root.root
@@ -3315,6 +3317,8 @@ class depgraph(object):
if not self._rebuild.rebuild:
if ignore_depend_deps:
edepend["DEPEND"] = ""
+ if ignore_bdepend_deps:
+ edepend["BDEPEND"] = ""
if ignore_hdepend_deps:
edepend["HDEPEND"] = ""
@@ -3335,6 +3339,10 @@ class depgraph(object):
self._priority(buildtime=True,
optional=(pkg.built or ignore_hdepend_deps),
ignored=ignore_hdepend_deps)),
+ (self._frozen_config._running_root.root, edepend["BDEPEND"],
+ self._priority(buildtime=True,
+ optional=(pkg.built or ignore_bdepend_deps),
+ ignored=ignore_bdepend_deps)),
)
debug = "--debug" in self._frozen_config.myopts
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 8596b89b1..137351a69 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -508,7 +508,7 @@ auxdbkeys = (
'DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'INHERITED', 'IUSE', 'REQUIRED_USE',
- 'PDEPEND', 'UNUSED_05', 'EAPI',
+ 'PDEPEND', 'BDEPEND', 'EAPI',
'PROPERTIES', 'DEFINED_PHASES', 'HDEPEND', 'UNUSED_04',
'UNUSED_03', 'UNUSED_02', 'UNUSED_01',
)
diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py
index 12639c6a1..59b25b606 100644
--- a/pym/portage/cache/metadata.py
+++ b/pym/portage/cache/metadata.py
@@ -29,7 +29,7 @@ class database(flat_hash.database):
auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION',
'KEYWORDS', 'INHERITED', 'IUSE', 'REQUIRED_USE',
- 'PDEPEND', 'UNUSED', 'EAPI', 'PROPERTIES',
+ 'PDEPEND', 'BDEPEND', 'EAPI', 'PROPERTIES',
'DEFINED_PHASES', 'HDEPEND')
autocommits = True
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 839897a41..fc48a6902 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -85,7 +85,7 @@ class bindbapi(fakedbapi):
self.move_ent = mybintree.move_ent
# Selectively cache metadata in order to optimize dep matching.
self._aux_cache_keys = set(
- ["BUILD_ID", "BUILD_TIME", "CHOST", "DEFINED_PHASES",
+ ["BDEPEND", "BUILD_ID", "BUILD_TIME", "CHOST", "DEFINED_PHASES",
"DEPEND", "EAPI", "HDEPEND", "IUSE", "KEYWORDS",
"LICENSE", "MD5", "PDEPEND", "PROPERTIES",
"PROVIDES", "RDEPEND", "repository", "REQUIRES", "RESTRICT",
@@ -312,7 +312,7 @@ class binarytree(object):
self._pkgindex_keys = self.dbapi._aux_cache_keys.copy()
self._pkgindex_keys.update(["CPV", "SIZE"])
self._pkgindex_aux_keys = \
- ["BASE_URI", "BUILD_ID", "BUILD_TIME", "CHOST",
+ ["BASE_URI", "BDEPEND", "BUILD_ID", "BUILD_TIME", "CHOST",
"DEFINED_PHASES", "DEPEND", "DESCRIPTION", "EAPI",
"HDEPEND", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND",
"PKGINDEX_URI", "PROPERTIES", "PROVIDES",
@@ -320,7 +320,7 @@ class binarytree(object):
"SIZE", "SLOT", "USE"]
self._pkgindex_aux_keys = list(self._pkgindex_aux_keys)
self._pkgindex_use_evaluated_keys = \
- ("DEPEND", "HDEPEND", "LICENSE", "RDEPEND",
+ ("BDEPEND", "DEPEND", "HDEPEND", "LICENSE", "RDEPEND",
"PDEPEND", "PROPERTIES", "RESTRICT")
self._pkgindex_header_keys = set([
"ACCEPT_KEYWORDS", "ACCEPT_LICENSE",
@@ -330,6 +330,7 @@ class binarytree(object):
"USE_EXPAND", "USE_EXPAND_HIDDEN", "USE_EXPAND_IMPLICIT",
"USE_EXPAND_UNPREFIXED"])
self._pkgindex_default_pkg_data = {
+ "BDEPEND" : "",
"BUILD_ID" : "",
"BUILD_TIME" : "",
"DEFINED_PHASES" : "",
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 1353ac666..69e14dbcd 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -312,7 +312,7 @@ class portdbapi(dbapi):
self._pregen_auxdb[x] = cache
# Selectively cache metadata in order to optimize dep matching.
self._aux_cache_keys = set(
- ["DEPEND", "EAPI", "HDEPEND",
+ ["BDEPEND", "DEPEND", "EAPI", "HDEPEND",
"INHERITED", "IUSE", "KEYWORDS", "LICENSE",
"PDEPEND", "PROPERTIES", "RDEPEND", "repository",
"RESTRICT", "SLOT", "DEFINED_PHASES", "REQUIRED_USE"])
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 6406682d6..bed76d80f 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -176,8 +176,8 @@ class vardbapi(dbapi):
vartree = portage.db[settings['EROOT']]['vartree']
self.vartree = vartree
self._aux_cache_keys = set(
- ["BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "DESCRIPTION",
- "EAPI", "HDEPEND", "HOMEPAGE",
+ ["BDEPEND", "BUILD_TIME", "CHOST", "COUNTER", "DEPEND",
+ "DESCRIPTION", "EAPI", "HDEPEND", "HOMEPAGE",
"BUILD_ID", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROPERTIES", "RDEPEND",
"repository", "RESTRICT" , "SLOT", "USE", "DEFINED_PHASES",
diff --git a/pym/portage/dep/_slot_operator.py b/pym/portage/dep/_slot_operator.py
index 8ce570d5a..bae94b30a 100644
--- a/pym/portage/dep/_slot_operator.py
+++ b/pym/portage/dep/_slot_operator.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2014 Gentoo Foundation
+# Copyright 2012-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
@@ -65,7 +65,10 @@ def evaluate_slot_operator_equal_deps(settings, use, trees):
for k in Package._runtime_keys:
_eval_deps(deps[k], vardbs)
- if eapi_attrs.hdepend:
+ if eapi_attrs.bdepend:
+ _eval_deps(deps["BDEPEND"], [running_vardb])
+ _eval_deps(deps["DEPEND"], [target_vardb])
+ elif eapi_attrs.hdepend:
_eval_deps(deps["HDEPEND"], [running_vardb])
_eval_deps(deps["DEPEND"], [target_vardb])
else:
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index d1ca299f5..5f0017b65 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -104,6 +104,10 @@ def eapi_has_automatic_unpack_dependencies(eapi):
def eapi_has_hdepend(eapi):
return eapi in ("5-hdepend",)
+def eapi_has_bdepend(eapi):
+ return eapi not in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi",
+ "5", "5-progress", "6")
+
def eapi_has_targetroot(eapi):
return eapi in ("5-hdepend",)
@@ -116,7 +120,7 @@ def eapi_path_variables_end_with_trailing_slash(eapi):
"5", "5-progress", "6")
_eapi_attrs = collections.namedtuple('_eapi_attrs',
- 'dots_in_PN dots_in_use_flags exports_EBUILD_PHASE_FUNC '
+ 'bdepend dots_in_PN dots_in_use_flags exports_EBUILD_PHASE_FUNC '
'exports_PORTDIR exports_ECLASSDIR '
'feature_flag_test feature_flag_targetroot '
'hdepend iuse_defaults iuse_effective posixish_locale '
@@ -144,6 +148,7 @@ def _get_eapi_attrs(eapi):
eapi = None
eapi_attrs = _eapi_attrs(
+ bdepend = (eapi is not None and eapi_has_bdepend(eapi)),
dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
empty_groups_always_true = (eapi is not None and eapi_empty_groups_always_true(eapi)),
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 65a009d05..68770e237 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -14,7 +14,8 @@ import re
# to enter the config instance from the external environment or
# configuration files.
env_blacklist = frozenset((
- "A", "AA", "CATEGORY", "DEPEND", "DESCRIPTION", "DOCS", "EAPI",
+ "A", "AA", "BDEPEND", "CATEGORY", "DEPEND", "DESCRIPTION",
+ "DOCS", "EAPI",
"EBUILD_FORCE_TEST", "EBUILD_PHASE",
"EBUILD_PHASE_FUNC", "EBUILD_SKIP_MANIFEST",
"ED", "EMERGE_FROM", "EPREFIX", "EROOT",
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 3dc64a067..9d2b34a53 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -155,7 +155,7 @@ class config(object):
_constant_keys = frozenset(['PORTAGE_BIN_PATH', 'PORTAGE_GID',
'PORTAGE_PYM_PATH', 'PORTAGE_PYTHONPATH'])
- _setcpv_aux_keys = ('DEFINED_PHASES', 'DEPEND', 'EAPI', 'HDEPEND',
+ _setcpv_aux_keys = ('BDEPEND', 'DEFINED_PHASES', 'DEPEND', 'EAPI', 'HDEPEND',
'INHERITED', 'IUSE', 'REQUIRED_USE', 'KEYWORDS', 'LICENSE', 'PDEPEND',
'PROPERTIES', 'RDEPEND', 'SLOT',
'repository', 'RESTRICT', 'LICENSE',)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-03-17 21:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-17 21:43 [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/dep/, pym/portage/package/ebuild/, pym/portage/, Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox