aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-09-07 23:50:36 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2022-12-04 17:17:18 +0100
commitac7b1c8e9464ff2fafd682ede144564d99930063 (patch)
treea0f25967359863f029b83f90ff1555fb77807f33 /include
parent439e19de967bffcc7a9fa4d2e16e873a67b95738 (diff)
downloadupstream-ac7b1c8e9464ff2fafd682ede144564d99930063.tar.gz
upstream-ac7b1c8e9464ff2fafd682ede144564d99930063.tar.bz2
upstream-ac7b1c8e9464ff2fafd682ede144564d99930063.zip
build: handle directory with whitespace in AUTOREMOVE clean
Package with whitespace in their build directory are not correctly removed when CONFIG_AUTOREMOVE is enabled. This is caused by xargs that use whitespace as delimiters. To handle this use \0 as the delimiter and set find to use \0 as the delimiter. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit dccee21792b89031bcd801030de403f195d80278)
Diffstat (limited to 'include')
-rw-r--r--include/host-build.mk4
-rw-r--r--include/package.mk4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/host-build.mk b/include/host-build.mk
index c6f594be35..22fcc31f15 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -198,8 +198,8 @@ ifndef DUMP
ifneq ($(CONFIG_AUTOREMOVE),)
host-compile:
- $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
- $(XARGS) rm -rf
+ $(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -print0 | \
+ $(XARGS) -0 rm -rf
endif
endef
endif
diff --git a/include/package.mk b/include/package.mk
index 4220f624ff..368bf0d7ca 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -259,8 +259,8 @@ define Build/CoreTargets
ifneq ($(CONFIG_AUTOREMOVE),)
compile:
-touch -r $(PKG_BUILD_DIR)/.built $(PKG_BUILD_DIR)/.autoremove 2>/dev/null >/dev/null
- $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
- $(XARGS) rm -rf
+ $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' -print0 | \
+ $(XARGS) -0 rm -rf
endif
endef