build: handle directory with whitespace in AUTOREMOVE clean
[openwrt/staging/hauke.git] / include / package.mk
index 389ba4243be3dc2c0ea1e5fc1d791da33db5e28f..225fdfc7711b59a038c760cc63f5eefb4ab2871c 100644 (file)
@@ -258,8 +258,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