Skip to content

Commit

Permalink
build: handle directory with whitespace in AUTOREMOVE clean
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit dccee21792b89031bcd801030de403f195d80278)
  • Loading branch information
Ansuel committed Dec 4, 2022
1 parent 006e525 commit 12b1d2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/host-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,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
Expand Down
4 changes: 2 additions & 2 deletions include/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 12b1d2f

Please sign in to comment.