summaryrefslogtreecommitdiff
path: root/lang/python/python3
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2019-05-29 22:42:02 +0800
committerJeffery To <jeffery.to@gmail.com>2019-05-29 22:42:02 +0800
commitb8e7a197db135c2b8749ed3c7bf94b3e712e1283 (patch)
treeb8deb3daf06c8b5fe4532c0a41f5d496f1f987e9 /lang/python/python3
parentbe751236aac05cb0df7fc184691cf7d9cfe173d4 (diff)
python3-setuptools,python3-pip: Use more predictable pycache cleanup
This uses two find commands to delete __pycache__ contents then the __pycache__ directories, rather than a for loop. The second command omits a -empty test, so that if the first command doesn't remove all directory contents for some reason, the second command will return an error (find will not delete a non-empty directory). Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python/python3')
-rw-r--r--lang/python/python3/files/python3-package-pip.mk6
-rw-r--r--lang/python/python3/files/python3-package-setuptools.mk6
2 files changed, 4 insertions, 8 deletions
diff --git a/lang/python/python3/files/python3-package-pip.mk b/lang/python/python3/files/python3-package-pip.mk
index 33f30abfa..a27d40a4e 100644
--- a/lang/python/python3/files/python3-package-pip.mk
+++ b/lang/python/python3/files/python3-package-pip.mk
@@ -22,10 +22,8 @@ define Py3Package/python3-pip/install
$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip \
$(PKG_BUILD_DIR)/install-pip/usr/lib/python$(PYTHON3_VERSION)/site-packages/pip-$(PYTHON3_PIP_VERSION).dist-info \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/
- for _ in \$(seq 1 10) ; do \
- find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ -exec rm -rf {} \; || continue ; \
- break ; \
- done
+ find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete
+ find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete
endef
$(eval $(call Py3BasePackage,python3-pip, \
diff --git a/lang/python/python3/files/python3-package-setuptools.mk b/lang/python/python3/files/python3-package-setuptools.mk
index ead951006..b3ccce895 100644
--- a/lang/python/python3/files/python3-package-setuptools.mk
+++ b/lang/python/python3/files/python3-package-setuptools.mk
@@ -25,10 +25,8 @@ define Py3Package/python3-setuptools/install
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
- for _ in \$(seq 1 10) ; do \
- find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ -exec rm -rf {} \; || continue ; \
- break ; \
- done
+ find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete
+ find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete
endef
$(eval $(call Py3BasePackage,python3-setuptools, \