From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Korsgaard Date: Mon, 24 Jan 2011 22:20:45 +0100 Subject: [Buildroot] [PATCH 08/10] Remove .py or .pyc depending on Python configuration In-Reply-To: (Thomas Petazzoni's message of "Mon, 24 Jan 2011 12:01:36 +0100") References: Message-ID: <87aaiqq9qq.fsf@macbook.be.48ers.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net >>>>> "Thomas" == Thomas Petazzoni writes: Thomas> We do this at a global level since several packages can install Thomas> Python modules. Thomas> Signed-off-by: Thomas Petazzoni Thomas> --- Thomas> Makefile | 8 ++++++++ Thomas> 1 files changed, 8 insertions(+), 0 deletions(-) Thomas> diff --git a/Makefile b/Makefile Thomas> index 7e08cf3..1f37a1f 100644 Thomas> --- a/Makefile Thomas> +++ b/Makefile Thomas> @@ -438,6 +438,14 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y) Thomas> rm -rf $(TARGET_DIR)/usr/share/gtk-doc Thomas> -rmdir $(TARGET_DIR)/usr/share 2>/dev/null Thomas> endif Thomas> +ifeq ($(BR2_PACKAGE_PYTHON),y) Thomas> +ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y) Thomas> + find $(TARGET_DIR)/usr/lib/ -name '*.pyc' -print0 | xargs -0 rm -f Thomas> +endif Thomas> +ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y) Thomas> + find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f Thomas> +endif Thomas> +endif The outermost conditional is not really needed. -- Bye, Peter Korsgaard