mirror of
https://github.com/openwrt/packages.git
synced 2025-12-19 17:11:21 +00:00
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 <ardeleanalex@gmail.com>
This commit is contained in:
@@ -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, \
|
||||
|
||||
Reference in New Issue
Block a user