From a495fe970496337011c0698a03476ce888a26105 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 24 Sep 2018 20:23:18 +0000 Subject: l3 (24sep18) git-svn-id: svn://tug.org/texlive/trunk@48749 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/l3build/l3build-ctan.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Master/texmf-dist/scripts/l3build/l3build-ctan.lua') diff --git a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua index f1e0757e9b0..b256ce21403 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua @@ -25,6 +25,9 @@ for those people who are interested. local pairs = pairs local print = print +local lower = string.lower +local match = string.match + -- Copy files to the main CTAN release directory function copyctan() mkdir(ctandir .. "/" .. ctanpkg) @@ -129,6 +132,17 @@ function ctan() cp(i, j, tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle) end end + -- Rename README if necessary + if ctanreadme ~= "" and not match(lower(ctanreadme),"^readme%.%w+") then + local newfile = "README." .. match(ctanreadme,"%.(%w+)$") + for _,dir in pairs({ctandir .. "/" .. ctanpkg, + tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle}) do + if fileexists(dir .. "/" .. ctanreadme) then + rm(dir,newfile) + ren(dir,ctanreadme,newfile) + end + end + end dirzip(tdsdir, ctanpkg .. ".tds") if packtdszip then cp(ctanpkg .. ".tds.zip", tdsdir, ctandir) -- cgit v1.2.3