summaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-09-07 23:50:36 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2022-09-11 11:27:02 +0200
commitdccee21792b89031bcd801030de403f195d80278 (patch)
tree3e406be739c9dfa4605ae3cd4c969e9369bedc9a /include/package.mk
parentd7382cc0e4446d4db1978055b0ba59259ac66751 (diff)
downloadopenwrt-dccee21792b89031bcd801030de403f195d80278.tar.gz
openwrt-dccee21792b89031bcd801030de403f195d80278.tar.bz2
openwrt-dccee21792b89031bcd801030de403f195d80278.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>
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/package.mk b/include/package.mk
index 509ef61e08..5861533bf5 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