[OpenWrt-Devel] [PATCH] build: fix STAGING_DIR cleaning when filenames contain spaces

Jeffery To jeffery.to at gmail.com
Thu May 2 13:33:27 EDT 2019

When looping through a package's STAGING_FILES_LIST (a list of
file/directory paths delimited by newlines), if the path contains
spaces, then the path will be split by the while loops, and the
file/directory will not be deleted/removed.

This sets the internal field separator to the newline only so that the
entire path is considered when deleting/removing.

Signed-off-by: Jeffery To <jeffery.to at gmail.com>
 scripts/clean-package.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index e580566a52..3a824929c6 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -1,4 +1,6 @@
 #!/usr/bin/env bash
 [ -n "$1" -a -n "$2" ] || {
 	echo "Usage: $0 <file> <directory>"
 	exit 1

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list