diff mbox series

[OpenWrt-Devel,v2] build: fix STAGING_DIR cleaning whenfilenames contain spaces

Message ID 20190515142017.27290-1-jeffery.to@gmail.com
State Accepted
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel,v2] build: fix STAGING_DIR cleaning whenfilenames contain spaces | expand

Commit Message

Jeffery To May 15, 2019, 2:20 p.m. UTC
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@gmail.com>
---
v2: use ksh93 syntax

 scripts/clean-package.sh | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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