diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-10 22:47:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-10 22:47:49 +0000 |
commit | 3260d8bfcfd2a4034265ea18664c7dd515722422 (patch) | |
tree | 94a969b6ad64c844025464401104d70b98d396f4 /Master/texmf-dist/scripts/l3build | |
parent | 633dc4da98d607dca3a3cb4906907ff634995d78 (diff) |
l3build (10feb19)
git-svn-id: svn://tug.org/texlive/trunk@49994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/l3build')
5 files changed, 52 insertions, 21 deletions
diff --git a/Master/texmf-dist/scripts/l3build/l3build-aux.lua b/Master/texmf-dist/scripts/l3build/l3build-aux.lua index d93c00c6745..2146d9a1424 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-aux.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-aux.lua @@ -97,7 +97,7 @@ function call(dirs, target, opts) local scriptname = getscriptname() for _,i in ipairs(dirs) do local text = " for module " .. i - if i == "." then + if i == "." and opts["config"] then text = " with configuration " .. opts["config"][1] end print("Running l3build with target \"" .. target .. "\"" .. text ) diff --git a/Master/texmf-dist/scripts/l3build/l3build-check.lua b/Master/texmf-dist/scripts/l3build/l3build-check.lua index 711d367331c..96c5d719949 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-check.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-check.lua @@ -1,6 +1,6 @@ --[[ -File l3build-check.lua Copyright (C) 2018 The LaTeX3 Project +File l3build-check.lua Copyright (C) 2018,2019 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -701,7 +701,7 @@ function runtest(name, engine, hide, ext, pdfmode, breakout) local npffile = basename .. "." .. engine .. pdfext local asciiopt = "" for _,i in ipairs(asciiengines) do - if realengine == i then + if binary == i then asciiopt = "-translate-file ./ascii.tcx " break end diff --git a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua index b256ce21403..09b10e0ecad 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua @@ -102,7 +102,7 @@ function ctan() standalone = true end if standalone then - errorlevel = check() + errorlevel = call({"."},"check") bundle = module else errorlevel = call(modules, "bundlecheck") diff --git a/Master/texmf-dist/scripts/l3build/l3build-upload.lua b/Master/texmf-dist/scripts/l3build/l3build-upload.lua index 4afee06b4ed..4256ed0854f 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-upload.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-upload.lua @@ -29,6 +29,7 @@ local tostring = tostring local close = io.close local flush = io.flush local open = io.open +local output = io.output local popen = io.popen local read = io.read local write = io.write @@ -93,9 +94,12 @@ function upload(tagnames) uploadconfig.announcement = assert(f:read('*a')) close(f) end - uploadconfig.announcement = options["message"] or uploadconfig.announcement + uploadconfig.announcement = options["message"] or uploadconfig.announcement or file_contents(uploadconfig.announcement_file) uploadconfig.email = options["email"] or uploadconfig.email + + uploadconfig.note = uploadconfig.note or file_contents(uploadconfig.note_file) + local tagnames = tagnames or { } uploadconfig.version = tagnames[1] or uploadconfig.version @@ -115,14 +119,27 @@ function upload(tagnames) ctan_post = construct_ctan_post(uploadfile,options["debug"]) - if options["debug"] then + +-- curl file version + local curlopt=open(ctanzip .. ".curlopt","w") + output(curlopt) + write(ctan_post) + close(curlopt) + + ctan_post=curlexe .. " --config " .. ctanzip .. ".curlopt" + + +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 - end +else + ctan_post = ctan_post .. ' https://ctan.org/submit/' +end -- call post command to validate the upload at CTAN's validate URL local exit_status=0 @@ -150,12 +167,12 @@ function upload(tagnames) end -- if upload requested and validation succeeded repost to the upload URL - if (exit_status==0 or exit_status==nil) then + if (exit_status==0 or exit_status==nil) then if (ctanupload ~=nil and ctanupload ~=false and ctanupload ~= true) then print("Validation successful, do you want to upload to CTAN? [y/n]" ) local answer="" - write("> ") - flush() + io.stdout:write("> ") + io.stdout:flush() answer=read() if(lower(answer,1,1)=="y") then ctanupload=true @@ -195,8 +212,9 @@ 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: -- field max desc mandatory multi @@ -225,12 +243,8 @@ 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 - if debug then - ctan_post = ctan_post .. ' https://httpbin.org/post' - else - ctan_post = ctan_post .. ' https://ctan.org/submit/' - end +-- 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) .. '"' return ctan_post @@ -270,7 +284,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") @@ -301,7 +316,7 @@ function input_multi_line_field (name) field = field .. "\n" .. answer_line end end - until (return_count==3 or answer_line==nil) + until (return_count==3 or answer_line==nil or answer_line=='\004') return field end @@ -316,3 +331,19 @@ function input_single_line_field(name) return field end + +-- if filename is non nil and file readable return contents otherwise nil +function file_contents (filename) + if filename ~= nil then + local f= open(filename,"r") + if f==nil then + return nil + else + local s = f:read("*all") + close(f) + return s + end + else + return nil + end +end diff --git a/Master/texmf-dist/scripts/l3build/l3build.lua b/Master/texmf-dist/scripts/l3build/l3build.lua index 78db32d4130..4c8cd86c075 100755 --- a/Master/texmf-dist/scripts/l3build/l3build.lua +++ b/Master/texmf-dist/scripts/l3build/l3build.lua @@ -25,7 +25,7 @@ for those people who are interested. --]] -- Version information -release_date = "2019-02-06" +release_date = "2019-02-10" -- File operations are aided by the LuaFileSystem module local lfs = require("lfs") |