From owner-freebsd-python@FreeBSD.ORG Thu Nov 4 13:50:12 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 CAFFD10656B1 for ; Thu, 4 Nov 2010 13:50:12 +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 B9D858FC0A for ; Thu, 4 Nov 2010 13:50:12 +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 oA4DoCTE075709 for ; Thu, 4 Nov 2010 13:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA4DoCsN075708; Thu, 4 Nov 2010 13:50:12 GMT (envelope-from gnats) Date: Thu, 4 Nov 2010 13:50:12 GMT Message-Id: <201011041350.oA4DoCsN075708@freefall.freebsd.org> To: freebsd-python@FreeBSD.org From: wen heping 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: wen heping List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2010 13:50:12 -0000 The following reply was made to PR ports/146957; it has been noted by GNATS. From: wen heping To: 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 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