From 714b1247b70b8b2c185aa30ae914fd90de826f41 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Thu, 16 Oct 2014 08:46:32 +0300 Subject: python: reduce bloat by removing *.pyo and *.pyc files 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 --- lang/python/files/python-package.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/python/files/python-package.mk') diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index 0196beeb6..6ac6051fa 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -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 \ -- cgit From 09c02844e497998dde3850fe231a3cc2d42f8125 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Thu, 16 Oct 2014 16:15:56 +0300 Subject: python: enforce the existence of files in the filespecs Seems that this allows some goofs, because some files silently do not get copied and the build succeeds, even though it shouldn't. Signed-off-by: Alexandru Ardelean --- lang/python/files/python-package.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lang/python/files/python-package.mk') diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index 6ac6051fa..dc30494fe 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -37,6 +37,10 @@ define PyPackage IFS='|'; \ while read fop fspec fperm; do \ if [ "$$$$$$$$fop" = "+" ]; then \ + if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \ + echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \ + exit 1; \ + fi; \ dpath=`dirname "$$$$$$$$fspec"`; \ if [ -n "$$$$$$$$fperm" ]; then \ dperm="-m$$$$$$$$fperm"; \ -- cgit