From 1bf7679211425bb0f63f22ce00c700c7d84eb2d4 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 5 Feb 2019 12:04:43 +0200 Subject: python,python3: make deletion tolerant for paths with spaces Piping to xargs does not handle spaces in paths too well, because it splits up the paths. For deleting empty dirs, we also need to do several retries, otherwise `find` will try to go through the directories after they're deleted. Signed-off-by: Alexandru Ardelean --- lang/python/python3/files/python3-package-pip.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lang/python/python3/files/python3-package-pip.mk') diff --git a/lang/python/python3/files/python3-package-pip.mk b/lang/python/python3/files/python3-package-pip.mk index 1aaeaf2ee..8e209e139 100644 --- a/lang/python/python3/files/python3-package-pip.mk +++ b/lang/python/python3/files/python3-package-pip.mk @@ -21,7 +21,10 @@ define Package/python3-pip/install $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip \ $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip-$(PYTHON3_PIP_VERSION).dist-info \ $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ - find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ | xargs rm -rf + for _ in \$(seq 1 10) ; do \ + find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ -exec rm -rf {} \; || continue ; \ + break ; \ + done endef $(eval $(call Py3BasePackage,python3-pip, \ -- cgit