From owner-freebsd-python@FreeBSD.ORG Fri Dec 22 06:01:55 2006 Return-Path: X-Original-To: freebsd-python@FreeBSD.org Delivered-To: freebsd-python@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8785616A403 for ; Fri, 22 Dec 2006 06:01:55 +0000 (UTC) (envelope-from alexbl@FreeBSD.org) Received: from cherenkov.geekfire.com (cherenkov.geekfire.com [66.206.86.94]) by mx1.freebsd.org (Postfix) with ESMTP id 6EC7513C428 for ; Fri, 22 Dec 2006 06:01:55 +0000 (UTC) (envelope-from alexbl@FreeBSD.org) Received: from localhost.my.domain (adsl-75-8-104-188.dsl.scrm01.sbcglobal.net [75.8.104.188]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cherenkov.geekfire.com (Postfix) with ESMTP id EAFA23A59F for ; Thu, 21 Dec 2006 21:41:30 -0800 (PST) From: Alexander Botero-Lowry To: freebsd-python@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <9015.1166766139.0@localhost> Date: Thu, 21 Dec 2006 21:42:54 -0800 Sender: alex@localhost X-Peer: 127.0.0.1 Message-Id: <20061222054134.EAFA23A59F@cherenkov.geekfire.com> Cc: Subject: approval to commit addition of PYTHON_VER variable X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2006 06:01:55 -0000 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9015.1166766139.1@localhost> Hey guys, With the further proliferation of Python eggs, it's about time for us python@ folks to start dealing with that seriously, but for now I don't want to start doing any restructing until 6.2 is out. With that in mind, I decided to add a PYTHON_VER variable to bsd.python.mk which is just the major number release (2.1, 2.2, 2.3, etc) of the installed Python version. This is used in the filename of eggs, and the solutions I have seen to derieve it are pretty scary. Among them are: EGGEXT=py2.4.egg # notice the hardcoded version number PYTHONVER?= ${_PYTHON_VERSION} # which annoys me for using an internal variable, but is sadly the cleanest solution. It's also bad because it's not hardcoded by ${PYTHON_VERSION} so it could be incorrect PYVER=${PYTHON_VERSION:S/python//} # this is the nice regex solution ${PYTHON_PKGNAMEPREFIX:C|([0-9])([0-9])|\1.\2|} # the nasty regex solution Basically, it's clear to me that i should just provide a ${PYTHON_VER} which is safely set in the ${PYTHON_VERSION} process so that the version number is correct. I've made up a patch for this, but wanted to be sure it was ok with portmgr, anyone on python@ is also welcome to comment on it. ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii"; name="python_ver.diff"; charset="us-ascii" Content-Description: ASCII text ? python_ver.diff Index: bsd.python.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.python.mk,v retrieving revision 1.90 diff -u -r1.90 bsd.python.mk --- bsd.python.mk 22 Dec 2006 05:26:01 -0000 1.90 +++ bsd.python.mk 22 Dec 2006 05:32:09 -0000 @@ -327,6 +327,7 @@ PYTHON_PORTSDIR= ${PORTSDIR}/lang/python25 PYTHON_REL= 250 PYTHON_SUFFIX= 25 +PYTHON_VER= 2.5 # Python-2.4 .elif ${PYTHON_VERSION} == "python2.4" @@ -334,6 +335,7 @@ PYTHON_PORTSDIR= ${PORTSDIR}/lang/python24 PYTHON_REL= 243 PYTHON_SUFFIX= 24 +PYTHON_VER= 2.4 # Python-2.3 .elif ${PYTHON_VERSION} == "python2.3" @@ -341,6 +343,7 @@ PYTHON_PORTSDIR= ${PORTSDIR}/lang/python23 PYTHON_REL= 235 PYTHON_SUFFIX= 23 +PYTHON_VER= 2.3 # Python-2.2 .elif ${PYTHON_VERSION} == "python2.2" @@ -348,6 +351,7 @@ PYTHON_PORTSDIR= ${PORTSDIR}/lang/python22 PYTHON_REL= 223 PYTHON_SUFFIX= 22 +PYTHON_VER= 2.2 # Python-2.1 .elif ${PYTHON_VERSION} == "python2.1" @@ -355,6 +359,7 @@ PYTHON_PORTSDIR= ${PORTSDIR}/lang/python21 PYTHON_REL= 213 PYTHON_SUFFIX= 21 +PYTHON_VER= 2.1 # Python versions in development .elif defined(FORCE_PYTHON_VERSION) @@ -364,6 +369,7 @@ 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]' .else check-makevars:: ------- =_aaaaaaaaaa0--