summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-24 20:23:18 +0000
committerKarl Berry <karl@freefriends.org>2018-09-24 20:23:18 +0000
commita495fe970496337011c0698a03476ce888a26105 (patch)
tree592b35bc873870f28ec4883e3ba0fdd6a4d68119 /Master/texmf-dist/scripts/l3build/l3build-ctan.lua
parent68966bb4bfd52e8d9d91b9fd5e6ff36d3d74a57e (diff)
l3 (24sep18)
git-svn-id: svn://tug.org/texlive/trunk@48749 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-ctan.lua')
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-ctan.lua14
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)