From e17f64c3fa3f0dc4e429a69f8a9f2c33bdafe8b3 Mon Sep 17 00:00:00 2001 From: Fabian Godehardt Date: Thu, 13 Sep 2012 12:42:51 +0200 Subject: [PATCH] generic/transport.lua: fixup curl support for http/https file transfer Signed-off-by: Fabian Godehardt --- generic/transport.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/generic/transport.lua b/generic/transport.lua index cef88dc..ae16ae3 100644 --- a/generic/transport.lua +++ b/generic/transport.lua @@ -160,11 +160,20 @@ function transport.fetch_file(surl, location, destdir, destname) -- fetch the file to the temporary directory if u.transport == "http" or u.transport == "https" then + local curl_argv = {} + local url_loc = string.format("%s/%s", u.url, location) + local dest_tmp = string.format("%s/%s", destdir, tmpfile) -- use special flags here - local curlflags = "--create-dirs --silent --show-error --fail" - local args = string.format("%s '%s/%s' -o '%s/%s'", - curlflags, u.url, location, destdir, tmpfile) - rc, re = e2lib.curl(args) + table.insert(curl_argv, "--create-dirs") + table.insert(curl_argv, "--silent") + table.insert(curl_argv, "--show-error") + table.insert(curl_argv, "--fail") + + table.insert(curl_argv, url_loc) + table.insert(curl_argv, "-o") + table.insert(curl_argv, dest_tmp) + + rc, re = e2lib.curl(curl_argv) if not rc then return false, e:cat(re) end -- 2.39.5