ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
define PYTHON_REMOVE_PY_FILES
- find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.py' -print0 | xargs -0 rm -f
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.py' -print0 | \
+ xargs -0 --no-run-if-empty rm -f
endef
TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PY_FILES
endif
ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y)
define PYTHON_REMOVE_PYC_FILES
- find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyc' -print0 | xargs -0 rm -f
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyc' -print0 | \
+ xargs -0 --no-run-if-empty rm -f
endef
TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYC_FILES
endif
# In all cases, we don't want to keep the optimized .pyo files
ifeq ($(BR2_PACKAGE_PYTHON),y)
define PYTHON_REMOVE_PYO_FILES
- find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyo' -print0 | xargs -0 --no-run-if-empty rm -f
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyo' -print0 | \
+ xargs -0 --no-run-if-empty rm -f
endef
TARGET_FINALIZE_HOOKS += PYTHON_REMOVE_PYO_FILES
endif
ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
define PYTHON3_REMOVE_PY_FILES
- find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' -print0 | xargs -0 rm -f
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.py' -print0 | \
+ xargs -0 --no-run-if-empty rm -f
endef
TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PY_FILES
endif
ifeq ($(BR2_PACKAGE_PYTHON3_PY_ONLY),y)
define PYTHON3_REMOVE_PYC_FILES
- find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.pyc' -print0 | xargs -0 rm -f
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.pyc' -print0 | \
+ xargs -0 --no-run-if-empty rm -f
endef
TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_PYC_FILES
endif
# variant.
ifeq ($(BR2_PACKAGE_PYTHON3),y)
define PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
- find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.opt-1.pyc' -print0 -o -name '*.opt-2.pyc' -print0 | xargs -0 rm -f
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR) -name '*.opt-1.pyc' -print0 -o -name '*.opt-2.pyc' -print0 | \
+ xargs -0 --no-run-if-empty rm -f
endef
TARGET_FINALIZE_HOOKS += PYTHON3_REMOVE_OPTIMIZED_PYC_FILES
endif