ports/146957: Mk/bsd.python.mk: PYTHONOPTIMIZE=1 in environ(7) breaks plist

Oliver Fromme olli at lurza.secnetix.de
Thu Nov 4 14:20:11 UTC 2010


The following reply was made to PR ports/146957; it has been noted by GNATS.

From: Oliver Fromme <olli at lurza.secnetix.de>
To: wen heping <wenheping at gmail.com>, bug-followup at FreeBSD.org,
        swell.k at 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 <wenheping at gmail.com> 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


More information about the freebsd-python mailing list