summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2017-03-21 20:01:25 +0100
committerPeter Korsgaard <peter@korsgaard.com>2017-03-21 22:14:17 +0100
commit2f6c5e513cf6688f9343a25ac90138e9ad751eb5 (patch)
tree825d46ad490f67c0d1a9d0d7a4ebb30c649828e7
parentb60757d9dad3c3248ca0a6f55c6574054a949052 (diff)
downloadbuildroot-2f6c5e513cf6688f9343a25ac90138e9ad751eb5.tar.gz
buildroot-2f6c5e513cf6688f9343a25ac90138e9ad751eb5.zip
support/check-bin-arch: fix for filenames with spaces
Filenames with spaces will break the current for loop. Fix that by using a while-read loop, fed with the list of files on stdin, using process substitution. Reported-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rwxr-xr-xsupport/scripts/check-bin-arch10
1 files changed, 6 insertions, 4 deletions
diff --git a/support/scripts/check-bin-arch b/support/scripts/check-bin-arch
index 2c619ad674..b3e2024617 100755
--- a/support/scripts/check-bin-arch
+++ b/support/scripts/check-bin-arch
@@ -18,9 +18,11 @@ fi
exitcode=0
-pkg_files=$(sed -r -e "/^${package},(.+)$/!d; s//\1/;" ${pkg_list})
+# Only split on new lines, for filenames-with-spaces
+IFS="
+"
-for f in ${pkg_files} ; do
+while read f; do
# Skip firmware files, they could be ELF files for other
# architectures
if [[ "${f}" =~ ^\./(usr/)?lib/firmware/.* ]]; then
@@ -43,10 +45,10 @@ for f in ${pkg_files} ; do
continue
fi
- printf 'ERROR: architecture for %s is %s, should be %s\n' \
+ printf 'ERROR: architecture for "%s" is "%s", should be "%s"\n' \
"${f}" "${arch}" "${arch_name}"
exitcode=1
-done
+done < <( sed -r -e "/^${package},\.(.+)$/!d; s//\1/;" ${pkg_list} )
exit ${exitcode}
OpenPOWER on IntegriCloud