From owner-freebsd-python@FreeBSD.ORG Thu Nov 4 14:20:11 2010 Return-Path: Delivered-To: freebsd-python@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBAF710656AD for ; Thu, 4 Nov 2010 14:20: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 AF5028FC12 for ; Thu, 4 Nov 2010 14:20:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oA4EKBYu008212 for ; Thu, 4 Nov 2010 14:20:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA4EKBjE008211; Thu, 4 Nov 2010 14:20:11 GMT (envelope-from gnats) Date: Thu, 4 Nov 2010 14:20:11 GMT Message-Id: <201011041420.oA4EKBjE008211@freefall.freebsd.org> To: freebsd-python@FreeBSD.org From: Oliver Fromme Cc: Subject: Re: ports/146957: Mk/bsd.python.mk: PYTHONOPTIMIZE=1 in environ(7) breaks plist X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Oliver Fromme List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2010 14:20:11 -0000 The following reply was made to PR ports/146957; it has been noted by GNATS. From: Oliver Fromme To: wen heping , bug-followup@FreeBSD.org, swell.k@gmail.com Cc: Subject: Re: ports/146957: Mk/bsd.python.mk: PYTHONOPTIMIZE=1 in environ(7) breaks plist Date: Thu, 4 Nov 2010 15:17:46 +0100 (CET) wen heping wrote: > Maybe we can resolve it by: > 1) Add a pkg-plist variable PYTHONOPT in bsd.python.mk: > PLIST_SUB+= PYTHONOPT=${PYTHONOPT} > 2) set PYTHONOPT='' when PYTHONOPTIMIZE is not defined and > set it to "@comment" when it is defined. > 3) Add %%PYTHONOPT%% to all lines ended with .pyc in pkg-plist file > > But I do not think it is a good way to resolv it and currently I could not > find a simple way to resolv it. Maybe the best way is just let it be? :) Why not simply remove PYTHONOPTIMIZE from the environment when it is set, or override it to be =""? Then you will always get the standard behaviour, i.e. both .pyc and .pyo will be created, and no change to the plist is necessary. If you want to make the creation of .pyc and/or .pyo files configurable, it should be done properly with the OPTIONS framework, with two settings, for example CREATE_PYC and CREATE_PYO, which should both default to ON. But I really don't think this is required ... I can't think of a reason why a user wouldn't want to have both installed. Disk space shouldn't be an issue nowadays. And on restricted hardware (such as small or embedded systems) you will probably create a hand-crafted installation anyway, omitting more than just the .pyc files which account for less than 25% of the size of the package. Anyawy, my point is that variables from the user's environment should not accidentally affect the contents of the package. Therefore I think that the Python ports makefile should unset or override the PYTHONOPTIMIZE variable. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." -- Robert Firth