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

wen heping wenheping at gmail.com
Thu Nov 4 13:50:12 UTC 2010


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

From: wen heping <wenheping at gmail.com>
To: 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 21:44:08 +0800

 Hi,
 
     When set PYTHONOPTIMIZE=1, that enable python use the optimize mode,
 just as run python with -O args. And when python run with -O args, it compile
 .py source file directly to .pyo file but without .pyc file. It will lead to
  the pkg-plist error that you mentioned.
 
    So it is not a bug in bsd.python.mk.
 
    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?  :)
 
 wen


More information about the freebsd-python mailing list