[latex3-commits] [git/LaTeX3-latex3-l3build] curl-file: version of ctan upload using curl --config to avoid the windows commandline (6e683d6)
David Carlisle
d.p.carlisle at gmail.com
Sat Feb 2 13:35:42 CET 2019
Repository : https://github.com/latex3/l3build
On branch : curl-file
Link : https://github.com/latex3/l3build/commit/6e683d61151655b09b14b24f899605ededf6620a
>---------------------------------------------------------------
commit 6e683d61151655b09b14b24f899605ededf6620a
Author: David Carlisle <d.p.carlisle at gmail.com>
Date: Sat Feb 2 12:35:42 2019 +0000
version of ctan upload using curl --config to avoid the windows commandline
>---------------------------------------------------------------
6e683d61151655b09b14b24f899605ededf6620a
l3build-upload.lua | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/l3build-upload.lua b/l3build-upload.lua
index 4afee06..97e846b 100644
--- a/l3build-upload.lua
+++ b/l3build-upload.lua
@@ -115,6 +115,11 @@ function upload(tagnames)
ctan_post = construct_ctan_post(uploadfile,options["debug"])
+-- curl file version
+ io.output(ctanzip .. ".curlopt")
+ io.write(ctan_post)
+ ctan_post=curlexe .. " --config " .. ctanzip .. ".curlopt"
+
if options["debug"] then
fp_return = shell(ctan_post)
print('\n\nCURL COMMAND:')
@@ -195,7 +200,8 @@ end
function construct_ctan_post(uploadfile,debug)
-- start building the curl command:
- ctan_post = curlexe .. " "
+-- commandline ctan_post = curlexe .. " "
+ ctan_post=""
-- build up the curl command field-by-field:
@@ -225,11 +231,14 @@ function construct_ctan_post(uploadfile,debug)
if os_type == "windows" then
qq = '\"'
end
- ctan_post = ctan_post .. ' --form ' .. qq .. 'file=@' .. tostring(uploadfile) .. ';filename=' .. tostring(uploadfile) .. qq
+-- commandline ctan_post = ctan_post .. ' --form ' .. qq .. 'file=@' .. tostring(uploadfile) .. ';filename=' .. tostring(uploadfile) .. qq
+ ctan_post = ctan_post .. '\nform="file=@' .. tostring(uploadfile) . ';filename=' .. tostring(uploadfile) .. '"'
if debug then
- ctan_post = ctan_post .. ' https://httpbin.org/post'
+-- commandline ctan_post = ctan_post .. ' https://httpbin.org/post'
+ ctan_post = ctan_post .. '\nurl=https://httpbin.org/post'
else
- ctan_post = ctan_post .. ' https://ctan.org/submit/'
+-- commandline ctan_post = ctan_post .. ' https://ctan.org/submit/'
+ ctan_post = ctan_post .. '\nurl=https://ctan.org/submit/'
end
return ctan_post
@@ -270,7 +279,8 @@ function ctan_single_field(fname,fvalue,max,desc,mandatory)
vs = vs:gsub('"','\\"')
vs = vs:gsub('`','\\`')
vs = vs:gsub('\n','\\n')
- ctan_post=ctan_post .. ' --form "' .. fname .. "=" .. vs .. '"'
+-- for strings on commandline version ctan_post=ctan_post .. ' --form "' .. fname .. "=" .. vs .. '"'
+ ctan_post=ctan_post .. '\nform="' .. fname .. '=' .. vs .. '"'
end
else
error("The value of the field '" .. fname .."' must be a scalar not a table")
More information about the latex3-commits
mailing list