build: handle directory with whitespace in AUTOREMOVE clean
[openwrt/staging/dedeckeh.git] / include / package.mk
index 509ef61e08822ff422be8cb37be1f959d16fb6c3..5861533bf504627f3880c7b2f5475c968dadcbcc 100644 (file)
@@ -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