Skip to content

Commit

Permalink
Better install --dry-run
Browse files Browse the repository at this point in the history
Key point here is that the 'cleanup' step is omitted.

Formatting of data is also improved.

We may wish to make the cleanup step less agressive once an uninstall
target is available: one might remove only the files matching those to
be created. (Or is that a bad idea? Aligns with what uninstall should
do in the first place.)
  • Loading branch information
josephwright committed Jan 3, 2018
1 parent 7a66465 commit 71d05f3
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions l3build.lua
Expand Up @@ -2201,22 +2201,26 @@ function install()
set_program_name("latex")
local texmfhome = options["texmfhome"] or var_value("TEXMFHOME")
local installdir = texmfhome .. "/tex/" .. moduledir
errorlevel = cleandir(installdir)
if errorlevel ~= 0 then
return errorlevel
end
print()
for _,i in ipairs(installfiles) do
if options["dry-run"] then
for _,file in pairs(filelist(unpackdir,i)) do
print("Would install " .. file)
if options["dry-run"] then
print("\n" .. "Installation root: " .. installdir
.. "\n" .. "Intallation files:"
)
for _,filetype in ipairs(installfiles) do
for _,file in pairs(filelist(unpackdir,filetype)) do
print("- " .. file)
end
else
errorlevel = cp(i, unpackdir, installdir)
end
else
errorlevel = cleandir(installdir)
if errorlevel ~= 0 then
return errorlevel
end
for _,filetype in ipairs(installfiles) do
errorlevel = cp(filetype, unpackdir, installdir)
if errorlevel ~= 0 then
return errorlevel
end
end
end
return 0
end
Expand Down

0 comments on commit 71d05f3

Please sign in to comment.