]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
support/download/file: fix file:// protocol handling
authorAngelo Compagnucci <angelo@amarulasolutions.com>
Tue, 8 May 2018 13:28:31 +0000 (15:28 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 13 May 2018 20:23:13 +0000 (22:23 +0200)
Since the rework of the download infrastructure, the "file" download
helper gets passed an URL that starts with file://, but forgets to
strip it before passing it to "cp", causing a failure as the "cp"
program isn't prepared for file paths starting with file://. This is
fixed by stripping the file:// at the beginning of the URL.

In addition, the path passed to cp lacked a slash between the
directory path and the filename part of the url. This is fixed by
adding a slash at the appropriate places.

Fixes the following build failure when the "file" download method is
used:

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@amarulasolutions.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/download/file

index fefd6d271c910a13bc2cf84a4f62e70403794836..6dd37b04dc6a63c413fc685f3f7f1a908ca99b08 100755 (executable)
@@ -40,4 +40,4 @@ _localfiles() {
     eval ${LOCALFILES} "${@}"
 }
 
-_localfiles ${verbose} "'${dir}${file}'" "'${output}'"
+_localfiles ${verbose} "'${dir##file://}/${file}'" "'${output}'"