diff options
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-ctan.lua')
-rw-r--r-- | Master/texmf-dist/scripts/l3build/l3build-ctan.lua | 14 |
1 files changed, 14 insertions, 0 deletions
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) |