[latex3-commits] [git/LaTeX3-latex3-l3build] master: Renames (2fa4a85)
LAURENS Jérôme
jerome.laurens at u-bourgogne.fr
Tue Feb 23 18:35:31 CET 2021
Repository : https://github.com/latex3/l3build
On branch : master
Link : https://github.com/latex3/l3build/commit/2fa4a85fcdbdd6aa8c0e6e52f1c747fef71310df
>---------------------------------------------------------------
commit 2fa4a85fcdbdd6aa8c0e6e52f1c747fef71310df
Author: LAURENS Jérôme <jerome.laurens at u-bourgogne.fr>
Date: Tue Feb 23 18:35:31 2021 +0100
Renames
As suggested, rename the outer variable instead of the inner
Change some names to be more explicit
Use of `ans` for `answer`.
One pair of () added to make operator precedence explicit.
>---------------------------------------------------------------
2fa4a85fcdbdd6aa8c0e6e52f1c747fef71310df
l3build-check.lua | 2 +-
l3build-install.lua | 36 ++++++++++++++++++------------------
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/l3build-check.lua b/l3build-check.lua
index 192f7eb..2c9ce22 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -1015,7 +1015,7 @@ function save(names)
return 1
end
for _,engine in pairs(engines) do
- local testengine = ((engine == stdengine and "") or "." .. engine)
+ local testengine = ((engine == stdengine and "") or ("." .. engine))
local out_file = name .. testengine .. test_type.reference
local gen_file = name .. "." .. engine .. test_type.generated
print("Creating and copying " .. out_file)
diff --git a/l3build-install.lua b/l3build-install.lua
index eb1f149..06dfeb3 100644
--- a/l3build-install.lua
+++ b/l3build-install.lua
@@ -162,19 +162,19 @@ function install_files(target,full,dry_run)
if next(filenames) then
if not dry_run then
for _,path in pairs(paths) do
- local dir_a = target .. "/" .. path
- if not cleanpaths[dir_a] then
- errorlevel = cleandir(dir_a)
+ local target_path = target .. "/" .. path
+ if not cleanpaths[target_path] then
+ errorlevel = cleandir(target_path)
if errorlevel ~= 0 then return errorlevel end
end
- cleanpaths[dir_a] = true
+ cleanpaths[target_path] = true
end
end
- for _,file in ipairs(filenames) do
+ for _,name in ipairs(filenames) do
if dry_run then
- print("- " .. file)
+ print("- " .. name)
else
- local path,file = splitpath(file)
+ local path,file = splitpath(name)
insert(installmap,
{file = file, source = sourcepaths[file], dest = target . "/" .. path})
end
@@ -187,30 +187,30 @@ function install_files(target,full,dry_run)
if errorlevel ~= 0 then return errorlevel end
-- Creates a 'controlled' list of files
- local function excludelist(dir,include,exclude)
+ local function create_list(dir,include,exclude)
+ dir = dir or currentdir
include = include or { }
exclude = exclude or { }
- dir = dir or currentdir
- local includelist = { }
- local excludelist_a = { }
+ local excludelist = { }
for _,glob_table in pairs(exclude) do
for _,glob in pairs(glob_table) do
for file,_ in pairs(tree(dir,glob)) do
- excludelist_a[file] = true
+ excludelist[file] = true
end
end
end
+ local ans = { }
for _,glob in pairs(include) do
for file,_ in pairs(tree(dir,glob)) do
- if not excludelist_a[file] then
- insert(includelist, file)
+ if not excludelist[file] then
+ insert(ans, file)
end
end
end
- return includelist
+ return ans
end
- local installlist = excludelist(unpackdir,installfiles,{scriptfiles})
+ local installlist = create_list(unpackdir,installfiles,{scriptfiles})
if full then
errorlevel = doc()
@@ -229,8 +229,8 @@ function install_files(target,full,dry_run)
end
-- Set up lists: global as they are also needed to do CTAN releases
- typesetlist = excludelist(docfiledir,typesetfiles,{sourcefiles})
- sourcelist = excludelist(sourcefiledir,sourcefiles,
+ typesetlist = create_list(docfiledir,typesetfiles,{sourcefiles})
+ sourcelist = create_list(sourcefiledir,sourcefiles,
{bstfiles,installfiles,makeindexfiles,scriptfiles})
if dry_run then
More information about the latex3-commits
mailing list.