public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-python <gentoo-python@lists.gentoo.org>
Subject: [gentoo-python] [PATCH] Don't warn about USE_PYTHON when the package does not support typical python versions
Date: Thu, 03 Jan 2013 18:13:36 -0500	[thread overview]
Message-ID: <50E610A0.7010205@gentoo.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 850 bytes --]

Attached is a quick and dirty patch to prevent the typical user from
being advised to set USE_PYTHON for packages which support both python2
and/or python3, but not 2.7 or 3.2.

If someone can come up with a better fix, by all means send it my way.

For example, see the message produced by dev-python/simplejson-3.0.4-r1.

 * It seems that you need to set USE_PYTHON to make sure that legacy
 * packages will be built with respect to PYTHON_TARGETS correctly:
 *
 *      USE_PYTHON='2.7'
 *
 * Please note that after changing the USE_PYTHON variable, you may need
 * to run 'python-updater' to rebuild affected packages.
 *
 * For more information on python.eclass compatibility, please see
 * the appropriate python-r1 User's Guide chapter [1].
 *
 * [1]
http://www.gentoo.org/proj/en/Python/python-r1/user-guide.xml#doc_chap2

[-- Attachment #1.2: python-r1-use-python-hack.patch --]
[-- Type: text/plain, Size: 1127 bytes --]

Index: python-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v
retrieving revision 1.34
diff -u -B -r1.34 python-r1.eclass
--- python-r1.eclass	2 Jan 2013 21:12:44 -0000	1.34
+++ python-r1.eclass	3 Jan 2013 22:58:55 -0000
@@ -382,6 +382,10 @@
 			# is installed.
 			if [[ ! ${py2+1} && ${dis_py2} ]]; then
 				debug-print "${FUNCNAME}: -> all py2 versions disabled"
+				if ! has python2_7 "${PYTHON_COMPAT[@]}"; then
+					debug-print "${FUNCNAME}: ---> package does not support 2.7"
+					return 0
+				fi
 				if has_version '=dev-lang/python-2*'; then
 					debug-print "${FUNCNAME}: ---> but =python-2* installed!"
 					return 1
@@ -389,6 +393,10 @@
 			fi
 			if [[ ! ${py3+1} && ${dis_py3} ]]; then
 				debug-print "${FUNCNAME}: -> all py3 versions disabled"
+				if ! has python3_2 "${PYTHON_COMPAT[@]}"; then
+					debug-print "${FUNCNAME}: ---> package does not support 3.2"
+					return 0
+				fi
 				if has_version '=dev-lang/python-3*'; then
 					debug-print "${FUNCNAME}: ---> but =python-3* installed!"
 					return 1

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

                 reply	other threads:[~2013-01-03 23:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=50E610A0.7010205@gentoo.org \
    --to=floppym@gentoo.org \
    --cc=gentoo-python@lists.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