From 0bc6e9fddc97aedebeac58d16dd4b4c62c450d8f Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Tue, 5 Aug 2025 01:14:12 +0800 Subject: [PATCH] Fix incorrect ctan_post https://github.com/latex3/l3build/blob/0e64fef4ac5aa093f43c4fdf6403a04abeff44e1/l3build-upload.lua#L185 shell() get incorrect ctan_post sh: line 2: form-string=announcement=XXXXXXXXXXXXX: command not found --- l3build-upload.lua | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/l3build-upload.lua b/l3build-upload.lua index cf0e917..7f94c0b 100644 --- a/l3build-upload.lua +++ b/l3build-upload.lua @@ -139,29 +139,13 @@ function upload(tagnames) ctan_post = construct_ctan_post(uploadfile,options["debug"]) --- curl file version - local curloptfile = uploadconfig.curlopt_file or (ctanzip .. ".curlopt") - ---@type file*? - local curlopt=assert(open(curloptfile,"w")) - ---@cast curlopt file* - output(curlopt) - write(ctan_post) - curlopt:close() - curlopt = nil - - ctan_post=curlexe .. " --config " .. curloptfile - - if options["debug"] then - ctan_post = ctan_post .. ' https://httpbin.org/post' fp_return = shell(ctan_post) print('\n\nCURL COMMAND:') print(ctan_post) print("\n\nHTTP RESPONSE:") print(fp_return) return 1 -else - ctan_post = ctan_post .. ' https://ctan.org/submit/' end -- call post command to validate the upload at CTAN's validate URL @@ -287,6 +271,24 @@ function construct_ctan_post(uploadfile,debug) ctan_post = ctan_post .. '\nform="file=@' .. tostring(uploadfile) .. ';filename=' .. tostring(uploadfile) .. '"' +-- curl file version + local curloptfile = uploadconfig.curlopt_file or (ctanzip .. ".curlopt") + ---@type file*? + local curlopt=assert(open(curloptfile,"w")) + ---@cast curlopt file* + output(curlopt) + write(ctan_post) + curlopt:close() + curlopt = nil + + ctan_post=curlexe .. " --config " .. curloptfile + + if debug then + ctan_post = ctan_post .. ' https://httpbin.org/post' + else + ctan_post = ctan_post .. ' https://ctan.org/submit/' + end + return ctan_post end