summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/l3build/l3build-install.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-12-09 21:05:14 +0000
committerKarl Berry <karl@freefriends.org>2021-12-09 21:05:14 +0000
commitd591e5abd44a7f052daf9e40281051f5aeeb2c02 (patch)
tree92674fe1a6f9c080c15b6d5fda2b77e8019bbdc3 /Master/texmf-dist/scripts/l3build/l3build-install.lua
parentaaf82f524c0dfe58de47f941d55875e5a7a3e8da (diff)
l3build (9dec21)
git-svn-id: svn://tug.org/texlive/trunk@61260 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-install.lua')
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-install.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/l3build/l3build-install.lua b/Master/texmf-dist/scripts/l3build/l3build-install.lua
index 78fe2d4b2f6..6a28463e653 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-install.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-install.lua
@@ -32,6 +32,7 @@ local var_value = kpse.var_value
local gsub = string.gsub
local lower = string.lower
local match = string.match
+local format = string.format
local insert = table.insert
@@ -107,6 +108,23 @@ function uninstall()
errorlevel = zapdir(path)
if errorlevel ~= 0 then return errorlevel end
end
+ -- We remove all directories which contain at least one ordinary file in the source tree
+ for src, dest in pairs(tdsdirs) do
+ dest = dest .. '/'
+ local skipdir
+ for _, p in ipairs(tree(src, '**')) do
+ local src = p.src:sub(2) -- Skip the first '.'
+ if skipdir and src:sub(1, #skipdir) ~= skipdir then
+ skipdir = nil
+ end
+ if (not skipdir) and (not direxists(p.cwd)) then
+ skipdir = dirname(src)
+ errorlevel = zapdir(dest .. skipdir)
+ if errorlevel ~= 0 then return errorlevel end
+ skipdir = skipdir .. '/'
+ end
+ end
+ end
return 0
end
@@ -287,6 +305,26 @@ function install_files(target,full,dry_run)
+ create_install_map(unpackdir,"makeindex",{makeindexfiles},module)
+ create_install_map(unpackdir,"scripts",{scriptfiles},module)
+ for src, dest in pairs(tdsdirs) do
+ dest = target .. '/' .. dest
+ insert(installmap,
+ {file = '*', source = src, dest = dest})
+ dest = dest .. '/'
+ local skipdir
+ for _, p in ipairs(tree(src, '**')) do
+ local src = p.src:sub(2) -- Skip the first '.'
+ if skipdir and src:sub(1, #skipdir) ~= skipdir then
+ skipdir = nil
+ end
+ if (not skipdir) and (not direxists(p.cwd)) then
+ skipdir = dirname(src)
+ errorlevel = cleandir(dest .. skipdir)
+ if errorlevel ~= 0 then return errorlevel end
+ skipdir = skipdir .. '/'
+ end
+ end
+ end
+
if errorlevel ~= 0 then return errorlevel end
-- Files are all copied in one shot: this ensures that cleandir()