Skip to content

Commit

Permalink
Add a dry-run capablity for install target (fixes #45)
Browse files Browse the repository at this point in the history
At present we don't have a short option name here: it's sufficiently
specialised that one doesn't seem required.
  • Loading branch information
josephwright committed Jan 3, 2018
1 parent 04595a4 commit 3bf8649
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions l3build.dtx
Expand Up @@ -314,6 +314,8 @@
% \item \texttt{--config} (\texttt{-c}) Configuration(s) to use for testing
% \item \texttt{--date} (\texttt{-d}) Date to use when setting version
% data
% \item \texttt{--dry-run} Runs the \texttt{install} target but does not copy
% any files: simply lists those that would be installed
% \item \texttt{--engine} (\texttt{-e}) Sets the engine to use for
% testing
% \item \texttt{--force} (\texttt{-f}) Force checks to run even if sanity
Expand Down
14 changes: 13 additions & 1 deletion l3build.lua
Expand Up @@ -257,6 +257,11 @@ local option_list =
short = "d",
type = "string"
},
["dry-run"] =
{
desc = "Dry run for install",
type = "boolean"
},
engine =
{
desc = "Sets the engine(s) to use for running test",
Expand Down Expand Up @@ -2199,8 +2204,15 @@ function install()
if errorlevel ~= 0 then
return errorlevel
end
print()
for _,i in ipairs(installfiles) do
errorlevel = cp(i, unpackdir, installdir)
if options["dry-run"] then
for _,file in pairs(filelist(unpackdir,i)) do
print("Would install " .. file)
end
else
errorlevel = cp(i, unpackdir, installdir)
end
if errorlevel ~= 0 then
return errorlevel
end
Expand Down

0 comments on commit 3bf8649

Please sign in to comment.