From owner-freebsd-python@FreeBSD.ORG Wed Jan 23 12:30:01 2013 Return-Path: Delivered-To: python@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0FD47741 for ; Wed, 23 Jan 2013 12:30:01 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward5h.mail.yandex.net (forward5h.mail.yandex.net [IPv6:2a02:6b8:0:f05::5]) by mx1.freebsd.org (Postfix) with ESMTP id BD6B7E6B for ; Wed, 23 Jan 2013 12:30:00 +0000 (UTC) Received: from smtp3h.mail.yandex.net (smtp3h.mail.yandex.net [84.201.186.20]) by forward5h.mail.yandex.net (Yandex) with ESMTP id 6CA38D013E9 for ; Wed, 23 Jan 2013 16:29:59 +0400 (MSK) Received: from smtp3h.mail.yandex.net (localhost [127.0.0.1]) by smtp3h.mail.yandex.net (Yandex) with ESMTP id 48C0E1B40020 for ; Wed, 23 Jan 2013 16:29:59 +0400 (MSK) Received: from ip-86-110-189-214.spark-rostov.ru (ip-86-110-189-214.spark-rostov.ru [86.110.189.214]) by smtp3h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TwbafUSP-Twb0J6Bm; Wed, 23 Jan 2013 16:29:59 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1358944199; bh=2QBIL2uWWhtt0Q6MCopokipXRduirMZVGB1Ff+VrGJE=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; b=n2wxUETj7GJsSX0HZnO/8u1wcsaGH55tpc/pjO+9LpPW7QiGduhg/SEwRdDZ3Qbqy EImTJqgRagHGcns7PYLYRG49qRoksdFkHxDiK9VAhAfTQLa7sOhD2rVdfMst53DR8Q 72Qye5CKYthT32DT7uXyrfSl45NMbUrQ0mloTcp0= Message-ID: <50FFD7C0.9060208@yandex.ru> Date: Wed, 23 Jan 2013 16:29:52 +0400 From: Ruslan Makhmatkhanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130114 Thunderbird/17.0.2 MIME-Version: 1.0 To: python Subject: bsd.python.mk: python3 plist shim Content-Type: multipart/mixed; boundary="------------050001020602030809000801" X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2013 12:30:01 -0000 This is a multi-part message in MIME format. --------------050001020602030809000801 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I'm planning to apply this patch to Mk/bsd.python.mk soon. It's an nivit's solution from devel/py-virtualenv for changes, introduced in PEP 3147 [1]. It will not affect default packages build, because packages are not yet building for python3 on cluster, but it will affect python ports, built with python3, that already has fix like that applied locally. I tested it with dozen of ports and everything seems fine. Local fixes will be removed right after this change. Please tell me if there is any objections or suggestions on this. Thanks. [1] http://www.python.org/dev/peps/pep-3147/ -- Regards, Ruslan Tinderboxing kills... the drives. --------------050001020602030809000801 Content-Type: text/plain; charset=UTF-8; name="py3-plist.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="py3-plist.diff.txt" Index: bsd.python.mk =================================================================== --- bsd.python.mk (revision 310860) +++ bsd.python.mk (working copy) @@ -666,6 +666,23 @@ .endif # defined(USE_TWISTED) +.if ${PYTHON_REL} >= 320 +# When Python version is 3.2+ we rewrite all the filenames +# of TMPPLIST that end with .py[co], so that they conform +# to PEP 3147 (see http://www.python.org/dev/peps/pep-3147/) +PYMAGICTAG= ${PYTHON_CMD} -c 'import imp; print(imp.get_tag())' +add-plist-post: + @${AWK} '\ + /\.py[co]$$/ && !($$0 ~ "/" pc "/") {id = match($$0, /\/[^\/]+\.py[co]$$/); if (id != 0) {d = substr($$0, 1, RSTART - 1); dirs[d] = 1}; sub(/\.py[co]$$/, "." mt "&"); sub(/[^\/]+\.py[co]$$/, pc "/&"); print; next} \ + /^@dirrm / {d = substr($$0, 8); if (d in dirs) {print $$0 "/" pc}; print $$0; next} \ + {print} \ + END {if (sp in dirs) {print "@dirrm " sp "/" pc}} \ + ' \ + pc="__pycache__" mt="$$(${PYMAGICTAG})" sp="${PYTHON_SITELIBDIR:S,${PYTHONBASE}/,,g}" \ + ${TMPPLIST} > ${TMPPLIST}.pyc_tmp + @${MV} ${TMPPLIST}.pyc_tmp ${TMPPLIST} +.endif + # XXX Hm, should I export some of the variables above to *_ENV? # If multiple Python versions are installed and cmake is used, it might --------------050001020602030809000801--