From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 2/7] python-r1.eclass: Move PYTHON_COMPAT_OVERRIDE warning into flag check
Date: Sat, 20 May 2017 15:30:39 +0200 [thread overview]
Message-ID: <20170520133044.9692-3-mgorny@gentoo.org> (raw)
In-Reply-To: <20170520133044.9692-1-mgorny@gentoo.org>
Move the PYTHON_COMPAT_OVERRIDE warning from _python_obtain_impls()
to _python_validate_useflags(). Since the latter function is the only
point where the former is called, this is a purely cosmetic change at
the moment. However, it makes it possible to reuse the warning in
additional places without the necessity of setting MULTIBUILD_VARIANTS.
---
eclass/python-r1.eclass | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 5eaa802e06b9..ae9e3806e729 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -242,10 +242,25 @@ if [[ ! ${_PYTHON_R1} ]]; then
# @FUNCTION: _python_validate_useflags
# @INTERNAL
# @DESCRIPTION:
-# Enforce the proper setting of PYTHON_TARGETS.
+# Enforce the proper setting of PYTHON_TARGETS, if PYTHON_COMPAT_OVERRIDE
+# is not in effect. If it is, just warn that the flags will be ignored.
_python_validate_useflags() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
+ if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
+ ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
+ ewarn "implementations will be enabled:"
+ ewarn
+ ewarn " ${PYTHON_COMPAT_OVERRIDE}"
+ ewarn
+ ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
+ _PYTHON_COMPAT_OVERRIDE_WARNED=1
+ fi
+ # we do not use flags with PCO
+ return
+ fi
+
local i
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
@@ -490,23 +505,13 @@ python_copy_sources() {
# @DESCRIPTION:
# Set up the enabled implementation list.
_python_obtain_impls() {
- if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
- if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
- ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
- ewarn "implementations will be enabled:"
- ewarn
- ewarn " ${PYTHON_COMPAT_OVERRIDE}"
- ewarn
- ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
- _PYTHON_COMPAT_OVERRIDE_WARNED=1
- fi
+ _python_validate_useflags
+ if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
return
fi
- _python_validate_useflags
-
MULTIBUILD_VARIANTS=()
local impl
--
2.13.0
next prev parent reply other threads:[~2017-05-20 13:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 13:30 [gentoo-dev] [PATCHES] python-r1.eclass: any-of dep API support Michał Górny
2017-05-20 13:30 ` [gentoo-dev] [PATCH 1/7] distutils-r1.eclass: Reuse python_setup for common phases Michał Górny
2017-05-20 13:30 ` Michał Górny [this message]
2017-05-20 13:30 ` [gentoo-dev] [PATCH 3/7] python-r1.eclass: Inline implementation loop logic into python_setup Michał Górny
2017-05-20 13:30 ` [gentoo-dev] [PATCH 4/7] python-r1.eclass: Support python_check_deps() in python_setup Michał Górny
2017-05-20 13:30 ` [gentoo-dev] [PATCH 5/7] python-r1.eclass: Add python_gen_any_dep, to create any-of deps Michał Górny
2017-05-20 13:30 ` [gentoo-dev] [PATCH 6/7] app-portage/gentoopm: Use any-of deps (example) Michał Górny
2017-05-20 13:30 ` [gentoo-dev] [PATCH 7/7] dev-python/backports-unittest-mock: Use any-of API for Sphinx (example) Michał Górny
2017-05-21 2:44 ` [gentoo-dev] [PATCHES] python-r1.eclass: any-of dep API support Alex Turbov
2017-05-21 7:30 ` Michał Górny
2017-05-28 3:59 ` Daniel Campbell
2017-06-06 6:59 ` Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170520133044.9692-3-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=python@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox