Date: Sun, 18 Mar 2012 08:08:57 -0800 (AKDT) From: Mel Flynn <rflynn@acsalaska.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: python@FreeBSD.org Subject: ports/166226: [patch] Mk/bsd.python.mk: Fix python -c commands for python 3+ Message-ID: <201203181608.q2IG8vo0022337@datakitty.lan.rachie.is-a-geek.net> Resent-Message-ID: <201203181610.q2IGABIF045914@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203181608.q2IG8vo0022337>