public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Dirkjan Ochtman (djc)" <djc@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: python.eclass
Date: Fri,  8 Jul 2011 07:39:03 +0000 (UTC)	[thread overview]
Message-ID: <20110708073903.CCA122004B@flycatcher.gentoo.org> (raw)

djc         11/07/08 07:39:03

  Modified:             python.eclass
  Log:
  Log syntax errors / warnings in python_mod_optimize().
  (Patch by Arfrever. Backported from python overlay.)

Revision  Changes    Path
1.119                eclass/python.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.eclass?rev=1.119&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.eclass?rev=1.119&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.eclass?r1=1.118&r2=1.119

Index: python.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- python.eclass	8 Jul 2011 07:37:49 -0000	1.118
+++ python.eclass	8 Jul 2011 07:39:03 -0000	1.119
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.118 2011/07/08 07:37:49 djc Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.119 2011/07/08 07:39:03 djc Exp $
 
 # @ECLASS: python.eclass
 # @MAINTAINER:
@@ -2596,7 +2596,7 @@
 
 	if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_for_multiple_python_abis || _python_implementation || [[ "${CATEGORY}/${PN}" == "sys-apps/portage" ]]; then
 		# PYTHON_ABI variable cannot be local in packages not supporting installation for multiple Python ABIs.
-		local allow_evaluated_non_sitedir_paths="0" dir dirs=() evaluated_dirs=() evaluated_files=() file files=() iterated_PYTHON_ABIS options=() other_dirs=() other_files=() previous_PYTHON_ABI="${PYTHON_ABI}" return_code root site_packages_dirs=() site_packages_files=()
+		local allow_evaluated_non_sitedir_paths="0" dir dirs=() evaluated_dirs=() evaluated_files=() file files=() iterated_PYTHON_ABIS options=() other_dirs=() other_files=() previous_PYTHON_ABI="${PYTHON_ABI}" return_code root site_packages_dirs=() site_packages_files=() stderr stderr_line
 
 		if _python_package_supporting_installation_for_multiple_python_abis; then
 			if has "${EAPI:-0}" 0 1 2 3 && [[ -z "${PYTHON_ABIS}" ]]; then
@@ -2701,6 +2701,7 @@
 		for PYTHON_ABI in ${iterated_PYTHON_ABIS}; do
 			if ((${#site_packages_dirs[@]})) || ((${#site_packages_files[@]})) || ((${#evaluated_dirs[@]})) || ((${#evaluated_files[@]})); then
 				return_code="0"
+				stderr=""
 				ebegin "Compilation and optimization of Python modules for $(python_get_implementation) $(python_get_version)"
 				if ((${#site_packages_dirs[@]})) || ((${#evaluated_dirs[@]})); then
 					for dir in "${site_packages_dirs[@]}"; do
@@ -2709,7 +2710,7 @@
 					for dir in "${evaluated_dirs[@]}"; do
 						eval "dirs+=(\"\${root}${dir}\")"
 					done
-					"$(PYTHON)" "${root}$(python_get_libdir)/compileall.py" "${options[@]}" "${dirs[@]}" || return_code="1"
+					stderr+="${stderr:+$'\n'}$("$(PYTHON)" "${root}$(python_get_libdir)/compileall.py" "${options[@]}" "${dirs[@]}" 2>&1)" || return_code="1"
 					if [[ "$(_python_get_implementation "${PYTHON_ABI}")" != "Jython" ]]; then
 						"$(PYTHON)" -O "${root}$(python_get_libdir)/compileall.py" "${options[@]}" "${dirs[@]}" &> /dev/null || return_code="1"
 					fi
@@ -2722,13 +2723,19 @@
 					for file in "${evaluated_files[@]}"; do
 						eval "files+=(\"\${root}${file}\")"
 					done
-					"$(PYTHON)" "${root}$(python_get_libdir)/py_compile.py" "${files[@]}" || return_code="1"
+					stderr+="${stderr:+$'\n'}$("$(PYTHON)" "${root}$(python_get_libdir)/py_compile.py" "${files[@]}" 2>&1)" || return_code="1"
 					if [[ "$(_python_get_implementation "${PYTHON_ABI}")" != "Jython" ]]; then
 						"$(PYTHON)" -O "${root}$(python_get_libdir)/py_compile.py" "${files[@]}" &> /dev/null || return_code="1"
 					fi
 					_python_clean_compiled_modules "${files[@]}"
 				fi
 				eend "${return_code}"
+				if [[ -n "${stderr}" ]]; then
+					eerror "Syntax errors / warnings in Python modules for $(python_get_implementation) $(python_get_version):" &> /dev/null
+					while read stderr_line; do
+						eerror "    ${stderr_line}"
+					done <<< "${stderr}"
+				fi
 			fi
 			unset dirs files
 		done
@@ -2744,22 +2751,29 @@
 
 		if ((${#other_dirs[@]})) || ((${#other_files[@]})); then
 			return_code="0"
+			stderr=""
 			ebegin "Compilation and optimization of Python modules placed outside of site-packages directories for $(python_get_implementation) $(python_get_version)"
 			if ((${#other_dirs[@]})); then
-				"$(PYTHON ${PYTHON_ABI})" "${root}$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" || return_code="1"
+				stderr+="${stderr:+$'\n'}$("$(PYTHON ${PYTHON_ABI})" "${root}$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" 2>&1)" || return_code="1"
 				if [[ "$(_python_get_implementation "${PYTHON_ABI}")" != "Jython" ]]; then
 					"$(PYTHON ${PYTHON_ABI})" -O "${root}$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" &> /dev/null || return_code="1"
 				fi
 				_python_clean_compiled_modules "${other_dirs[@]}"
 			fi
 			if ((${#other_files[@]})); then
-				"$(PYTHON ${PYTHON_ABI})" "${root}$(python_get_libdir)/py_compile.py" "${other_files[@]}" || return_code="1"
+				stderr+="${stderr:+$'\n'}$("$(PYTHON ${PYTHON_ABI})" "${root}$(python_get_libdir)/py_compile.py" "${other_files[@]}" 2>&1)" || return_code="1"
 				if [[ "$(_python_get_implementation "${PYTHON_ABI}")" != "Jython" ]]; then
 					"$(PYTHON ${PYTHON_ABI})" -O "${root}$(python_get_libdir)/py_compile.py" "${other_files[@]}" &> /dev/null || return_code="1"
 				fi
 				_python_clean_compiled_modules "${other_files[@]}"
 			fi
 			eend "${return_code}"
+			if [[ -n "${stderr}" ]]; then
+				eerror "Syntax errors / warnings in Python modules placed outside of site-packages directories for $(python_get_implementation) $(python_get_version):" &> /dev/null
+				while read stderr_line; do
+					eerror "    ${stderr_line}"
+				done <<< "${stderr}"
+			fi
 		fi
 	else
 		# Deprecated part of python_mod_optimize()






             reply	other threads:[~2011-07-08  7:39 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08  7:39 Dirkjan Ochtman (djc) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-06  5:34 [gentoo-commits] gentoo-x86 commit in eclass: python.eclass Mike Frysinger (vapier)
2011-12-19  1:29 Robin H. Johnson (robbat2)
2011-11-30  8:55 Dirkjan Ochtman (djc)
2011-11-18 23:37 Mike Frysinger (vapier)
2011-10-15 20:58 PaweA Hajdan (phajdan.jr)
2011-10-07 10:57 Dirkjan Ochtman (djc)
2011-10-07 10:55 Dirkjan Ochtman (djc)
2011-10-07 10:53 Dirkjan Ochtman (djc)
2011-10-07 10:52 Dirkjan Ochtman (djc)
2011-10-07 10:49 Dirkjan Ochtman (djc)
2011-10-07 10:48 Dirkjan Ochtman (djc)
2011-09-10 13:48 Dirkjan Ochtman (djc)
2011-08-19 12:16 Fabio Erculiani (lxnay)
2011-08-19 10:18 Fabio Erculiani (lxnay)
2011-08-19 10:10 Fabio Erculiani (lxnay)
2011-07-08  7:49 Dirkjan Ochtman (djc)
2011-07-08  7:48 Dirkjan Ochtman (djc)
2011-07-08  7:47 Dirkjan Ochtman (djc)
2011-07-08  7:46 Dirkjan Ochtman (djc)
2011-07-08  7:44 Dirkjan Ochtman (djc)
2011-07-08  7:43 Dirkjan Ochtman (djc)
2011-07-08  7:41 Dirkjan Ochtman (djc)
2011-07-08  7:40 Dirkjan Ochtman (djc)
2011-07-08  7:37 Dirkjan Ochtman (djc)
2011-07-04 11:28 Dirkjan Ochtman (djc)
2011-07-04 11:27 Dirkjan Ochtman (djc)
2011-07-04 11:27 Dirkjan Ochtman (djc)
2011-07-04 11:00 Dirkjan Ochtman (djc)
2011-07-04 10:59 Dirkjan Ochtman (djc)
2011-07-04 10:50 Dirkjan Ochtman (djc)
2011-07-04 10:48 Dirkjan Ochtman (djc)
2011-03-10 17:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
2011-02-14 20:46 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-12-31 21:51 Jonathan Callen (abcd)
2010-12-26 11:30 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-12-24 15:01 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-10-29 19:09 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-10-25 11:54 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-10-03  0:38 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-07-18 20:45 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-07-17 23:02 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-05-29 16:39 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-05-25 19:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-05-25 15:04 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-05-17 18:01 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-03-26 15:23 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-03-20 17:59 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-03-13 13:46 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-03-12 18:27 Petteri Raty (betelgeuse)
2010-03-04 17:42 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-28 15:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-28 11:48 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-14 18:53 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-11 18:52 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-02 18:55 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-01-15 14:46 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-01-14 19:23 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-01-11 16:07 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-01-10 17:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-12-23 23:43 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-22 16:45 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-22 13:48 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-15 22:00 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-15 14:25 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-10-11 13:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-10-02 23:09 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-10-02 17:32 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-10-02  2:02 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-18 17:50 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-11 19:55 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-09  4:16 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-05 17:30 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-31 23:58 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-31  0:07 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-29  2:15 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-28 16:08 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-15 23:32 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-15 21:50 Petteri Raty (betelgeuse)
2009-08-14 21:22 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-13 16:57 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-07  0:43 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-05 18:31 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-04 21:01 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-03 22:28 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-02 16:56 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-05-27 22:49 Petteri Raty (betelgeuse)
2008-10-30  5:21 Zac Medico (zmedico)
2008-10-27 12:23 Ali Polatel (hawking)
2008-10-27  0:17 Ali Polatel (hawking)
2008-10-26 21:54 Ali Polatel (hawking)
2008-10-26 21:21 Ali Polatel (hawking)
2008-10-26 17:46 Ali Polatel (hawking)
2008-10-26 17:34 Ali Polatel (hawking)
2008-10-26 17:26 Ali Polatel (hawking)
2008-10-26 17:11 Ali Polatel (hawking)
2008-09-01 14:11 Ali Polatel (hawking)
2008-08-29 19:28 Ali Polatel (hawking)
2008-08-01 22:22 Rob Cakebread (pythonhead)
2008-07-28 21:56 Rob Cakebread (pythonhead)
2008-05-30  9:58 Ali Polatel (hawking)
2008-05-29 22:03 Ali Polatel (hawking)
2008-05-29 21:19 Ali Polatel (hawking)
2008-05-29 20:01 Ali Polatel (hawking)
2008-05-29 18:36 Ali Polatel (hawking)
2008-05-29 15:24 Ali Polatel (hawking)
2008-05-29 14:10 Ali Polatel (hawking)
2008-03-28  7:11 Ali Polatel (hawking)

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=20110708073903.CCA122004B@flycatcher.gentoo.org \
    --to=djc@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@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