python: reduce bloat by removing *.pyo and *.pyc files
authorAlexandru Ardelean <redacted>
Thu, 16 Oct 2014 05:46:32 +0000 (08:46 +0300)
committerAlexandru Ardelean <redacted>
Fri, 17 Oct 2014 07:25:43 +0000 (10:25 +0300)
Seems that if you add a package folder this would also
include the compiled python files which increases fw size.

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/files/python-package.mk

index 0196beeb68373c7b11f6d3449fa5910ee9f6ce9e..6ac6051fa64c1ea6ecc457c5f66ba5b386f38afa 100644 (file)
@@ -32,6 +32,7 @@ define PyPackage
   $(call shexport,PyPackage/$(1)/filespec)
 
   define Package/$(1)/install
+       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
        @$(SH_FUNC) getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \
                IFS='|'; \
                while read fop fspec fperm; do \
git clone https://git.99rst.org/PROJECT