]> git.e2factory.org Git - e2factory.git/commitdiff
generic/transport.lua: fixup curl support for http/https file transfer
authorFabian Godehardt <fg@emlix.com>
Thu, 13 Sep 2012 10:42:51 +0000 (12:42 +0200)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:10 +0000 (19:07 +0100)
Signed-off-by: Fabian Godehardt <fg@emlix.com>
generic/transport.lua

index cef88dcf8e0c797594e3d6f1954616856a6e70c9..ae16ae3b4c44e195cff66b49c9b72a825c8a9b80 100644 (file)
@@ -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