Skip to content

Fix incorrect ctan_post #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions l3build-upload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down