[latex3-commits] [git/LaTeX3-latex3-l3build] ctan-post: ctan-post: quote (92347fa)

Will Robertson wspr81 at gmail.com
Fri Dec 7 01:24:41 CET 2018


Repository : https://github.com/latex3/l3build
On branch  : ctan-post
Link       : https://github.com/latex3/l3build/commit/92347fa41df68a8b4ecbddcc475264917a493d16

>---------------------------------------------------------------

commit 92347fa41df68a8b4ecbddcc475264917a493d16
Author: Will Robertson <wspr81 at gmail.com>
Date:   Mon Sep 17 21:39:12 2018 +0930

    ctan-post: quote
    
    code markdown in my announcement text was trying to be executed :)
    
    (also fix a 'cleanup' that broke things)


>---------------------------------------------------------------

92347fa41df68a8b4ecbddcc475264917a493d16
 l3build-ctan-post.lua |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/l3build-ctan-post.lua b/l3build-ctan-post.lua
index 658d401..1b8ea80 100644
--- a/l3build-ctan-post.lua
+++ b/l3build-ctan-post.lua
@@ -63,6 +63,8 @@ local ctanupload = ctanupload or "ask"
 
 function ctan_upload ()
 
+  ctan_post = ctan_post_command .. " "
+
   --         field                               max  desc                               mandatory  multi
   --         --------------------------------------------------------------------------------------------
   ctan_field("pkg",          ctan_pkg,            32, "the package name",                     true, false )
@@ -85,7 +87,6 @@ function ctan_upload ()
   ctan_field("note",         ctan_note,         4096, "internal note to ctan",               false, false )
 
   -- construct the curl command
-  ctan_post = ctan_post_command .. " "
   ctan_post = ctan_post .. " --form 'file=@" .. tostring(ctan_file) .. ";filename=" .. tostring(ctan_file) .. "'"
   ctan_post = ctan_post ..  " https://ctan.org/submit/"
 
@@ -181,7 +182,9 @@ function ctan_single_field(fname,fvalue,max,desc,mandatory)
       if (max > 0 and string.len(vs) > max) then
         error("The field " .. fname .. " is longer than " .. max)
       end
-      ctan_post=ctan_post .." --form " .. fname .. '="' .. vs:gsub('"','\\"') .. '"'
+      vs = vs:gsub('"','\\"')
+      vs = vs:gsub('`','\\`')
+      ctan_post=ctan_post .." --form " .. 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