[Buildroot] [PATCH v2] support/download/file: fix file:// protocol handling
Angelo Compagnucci
angelo at amarulasolutions.com
Tue May 8 13:28:31 UTC 2018
When a file is used a source for download using the file:// protocol, a
malformed url is passed to the file download script which then crashes.
Following an example of a wrong path passed to the script:
eval cp -v ''\''file:///home/angelo/DEV/TOOLCHAINSarmv7-eabihf--glibc--bleeding-edge-2017.11-1.tar.bz2'\''' ''\''/home/angelo/DEV/BUILDROOT/br_qemu_arm/build/.armv7-eabihf--glibc--bleeding-edge-2017.11-1.tar.bz2.f403PT/output'\'''.
Path passed to cp lacks of a / between dir and file part of the url,
moreover it presents a wrong file:// prefix.
Fixes:
cp: cannot stat
'file:///home/angelo/DEV/TOOLCHAINSarmv7-eabihf--glibc--bleeding-edge-2017.11-1.tar.bz2':
No such file or directory
Signed-off-by: Angelo Compagnucci <angelo at amarulasolutions.com>
---
support/download/file | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support/download/file b/support/download/file
index fefd6d2..6dd37b0 100755
--- a/support/download/file
+++ b/support/download/file
@@ -40,4 +40,4 @@ _localfiles() {
eval ${LOCALFILES} "${@}"
}
-_localfiles ${verbose} "'${dir}${file}'" "'${output}'"
+_localfiles ${verbose} "'${dir##file://}/${file}'" "'${output}'"
--
2.7.4
More information about the buildroot
mailing list