From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Mar 18 16:10:11 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABD351065676 for ; Sun, 18 Mar 2012 16:10:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 872708FC15 for ; Sun, 18 Mar 2012 16:10:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2IGABGu045915 for ; Sun, 18 Mar 2012 16:10:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q2IGABIF045914; Sun, 18 Mar 2012 16:10:11 GMT (envelope-from gnats) Resent-Date: Sun, 18 Mar 2012 16:10:11 GMT Resent-Message-Id: <201203181610.q2IGABIF045914@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mel Flynn Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78731106566B; Sun, 18 Mar 2012 16:08:59 +0000 (UTC) (envelope-from mel@datakitty.lan.rachie.is-a-geek.net) Received: from datakitty.lan.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 229E78FC08; Sun, 18 Mar 2012 16:08:58 +0000 (UTC) Received: from datakitty.lan.rachie.is-a-geek.net (localhost [127.0.0.1]) by datakitty.lan.rachie.is-a-geek.net (8.14.5/8.14.5) with ESMTP id q2IG8vLS022338; Sun, 18 Mar 2012 08:08:57 -0800 (AKDT) (envelope-from mel@datakitty.lan.rachie.is-a-geek.net) Received: (from mel@localhost) by datakitty.lan.rachie.is-a-geek.net (8.14.5/8.14.5/Submit) id q2IG8vo0022337; Sun, 18 Mar 2012 08:08:57 -0800 (AKDT) (envelope-from mel) Message-Id: <201203181608.q2IG8vo0022337@datakitty.lan.rachie.is-a-geek.net> Date: Sun, 18 Mar 2012 08:08:57 -0800 (AKDT) From: Mel Flynn To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: python@FreeBSD.org Subject: ports/166226: [patch] Mk/bsd.python.mk: Fix python -c commands for python 3+ X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mel Flynn List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 16:10:11 -0000 >Number: 166226 >Category: ports >Synopsis: [patch] Mk/bsd.python.mk: Fix python -c commands for python 3+ >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 18 16:10:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Mel Flynn >Release: FreeBSD 8.2-STABLE amd64 >Organization: >Environment: System: FreeBSD datakitty.lan.rachie.is-a-geek.net 8.2-STABLE FreeBSD 8.2-STABLE #6 r230977: Sun Feb 5 06:20:11 AKST 2012 mel@datakitty.lan.rachie.is-a-geek.net:/data/obj/data/RELENG_8/src/sys/GENERIC amd64 >Description: Incompatibilities with python 3.x cause several commands in bsd.python.mk to fail. The net result is that when python 3.1+ is installed, any port setting USE_PYTHON will pull in the default python version and several variables that should be available to dependent ports are not. >How-To-Repeat: Install lang/python31 (uninstall lang/python27 if installed). make -C /usr/ports/devel/talloc -V BUILD_DEPENDS >Fix: --- fix-python-3.x.patch begins here --- Index: Mk/bsd.python.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.python.mk,v retrieving revision 1.142 diff -u -r1.142 bsd.python.mk --- Mk/bsd.python.mk 7 Nov 2011 12:40:53 -0000 1.142 +++ Mk/bsd.python.mk 18 Mar 2012 14:39:38 -0000 @@ -264,7 +268,7 @@ .if !defined(PYTHON_DEFAULT_VERSION) . if exists(${LOCALBASE}/bin/python) _PYTHON_DEFAULT_VERSION!= (${LOCALBASE}/bin/python -c \ - 'import sys; print sys.version[:3]' 2> /dev/null \ + 'import sys; print(sys.version[:3])' 2> /dev/null \ || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1 . else _PYTHON_DEFAULT_VERSION= ${_PYTHON_PORTBRANCH} @@ -336,7 +340,7 @@ PYTHON_VERSION?= python${_PYTHON_VERSION} PYTHON_CMD?= ${_PYTHON_CMD} .if !defined(PYTHONBASE) -PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print sys.prefix' \ +PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print(sys.prefix)' \ 2> /dev/null || ${ECHO_CMD} ${LOCALBASE}) | ${TAIL} -1 .endif DEPENDS_ARGS+= PYTHON_VERSION=${PYTHON_VERSION} @@ -345,8 +349,8 @@ # should point to some other version we have installed, according to the port USE_PYTHON # specification .if !defined(PYTHON_DEFAULT_PORTVERSION) || (${PYTHON_VERSION} != ${PYTHON_DEFAULT_VERSION}) -_PYTHON_PORTVERSION!= (${PYTHON_CMD} -c 'import string, sys; \ - print string.split(sys.version)[0].replace("b",".b")' 2> /dev/null) | ${TAIL} -1 +_PYTHON_PORTVERSION!= (${PYTHON_CMD} -c 'import sys; \ + print(sys.version.split()[0].replace("b",".b"))' 2> /dev/null) | ${TAIL} -1 .if !defined(PYTHON_NO_DEPENDS) && !empty(_PYTHON_PORTVERSION) PYTHON_PORTVERSION= ${_PYTHON_PORTVERSION} .endif @@ -413,10 +417,10 @@ PYTHON_PORTSDIR= # empty PYTHON_NO_DEPENDS= YES PYTHON_REL!= ${PYTHON_CMD} -c 'import sys; h = "%x" % sys.hexversion; \ - print h[0]+h[2]+h[4]' + print(h[0]+h[2]+h[4])' PYTHON_SUFFIX!= ${PYTHON_CMD} -c 'import sys; h = "%x" % sys.hexversion; \ - print h[0]+h[2]' -PYTHON_VER!= ${PYTHON_CMD} -c 'import sys; print sys.version[:3]' + print(h[0]+h[2])' +PYTHON_VER!= ${PYTHON_CMD} -c 'import sys; print(sys.version[:3])' .else check-makevars:: --- fix-python-3.x.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: