From patchwork Sun Jan 27 22:42:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 216076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 77EDF2C0095 for ; Mon, 28 Jan 2013 09:43:09 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 51B41FFE17; Sun, 27 Jan 2013 22:42:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fyFa3ztqRpEo; Sun, 27 Jan 2013 22:42:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5AF8A1000A0; Sun, 27 Jan 2013 22:42:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 17D7D8F74B for ; Sun, 27 Jan 2013 22:43:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 097178A66F for ; Sun, 27 Jan 2013 22:43:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3fp1RO07c8JB for ; Sun, 27 Jan 2013 22:42:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from viper.mind.be (132.79-246-81.adsl-static.isp.belgacom.be [81.246.79.132]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5D0578A3B6 for ; Sun, 27 Jan 2013 22:42:59 +0000 (UTC) Received: from [172.16.2.6] by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1TzawE-0005gi-2d; Sun, 27 Jan 2013 23:42:58 +0100 Message-ID: <5105AD6F.4070105@mind.be> Date: Sun, 27 Jan 2013 23:42:55 +0100 From: Arnout Vandecappelle Organization: Essensium/Mind User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130112 Icedove/17.0.2 MIME-Version: 1.0 To: Daniel Nelson References: <1359313382-2257-1-git-send-email-daniel@sigpwr.com> In-Reply-To: <1359313382-2257-1-git-send-email-daniel@sigpwr.com> Cc: buildroot@busybox.net Subject: Re: [Buildroot] [PATCH] Fix PYC-only installation for Python3 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net On 27/01/13 20:03, Daniel Nelson wrote: > All, > > This is my first buildroot/open source submission. I'd appreciate some feedback. > > Python3 changes the behavior of .pyc caching, breaking the PYC-only option in buildroot. The details are inhttp://www.python.org/dev/peps/pep-3147 > > I've added a configure flag to Python3, and corresponding logic in buildroot. Hasn't this been fixed in git 6ffab129 ? Regards, Arnout commit 6ffab129a3ebc76caf7ae40caf1f6b0185f3e114 Author: Maxime Ripard Date: Fri Jan 18 04:06:14 2013 +0000 python3: Handle properly the pyc and py files on the target Fixes #5690 Signed-off-by: Maxime Ripard Acked-by: Samuel Martin Signed-off-by: Peter Korsgaard diff --git a/package/python3/python3.mk b/package/python3/python3.mk index 0d54162..e7c0983 100644 --- a/package/python3/python3.mk +++ b/package/python3/python3.mk @@ -155,5 +155,27 @@ endef ifneq ($(BR2_PACKAGE_PYTHON),y) PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_INSTALL_SYMLINK endif + +ifeq ($(BR2_PACKAGE_PYTHON3_PY_ONLY),y) +define PYTHON3_REMOVE_MODULES_FILES + for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) \ + -name __pycache__` ; do \ + rm -rf $$i ; \ + done +endef +endif + +ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y) +define PYTHON3_REMOVE_MODULES_FILES + for i in `find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) \ + -name *.py` ; do \ + rm -f $$i ; \ + done +endef +endif + +PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_REMOVE_MODULES_FILES + + $(eval $(autotools-package)) $(eval $(host-autotools-package))