diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-03-07 18:37:04 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-03-07 18:37:04 +0000 |
commit | 9ab2d3c5f82467ce2947c034305c688a0f6bfec9 (patch) | |
tree | 1884e0b2430baf4ba4a75dc0348820fe0ccc1e6e /stand/lua/config.lua | |
parent | 4e6bbdd6feef36a74cdabe03f37c396b739bd7ec (diff) | |
download | src-9ab2d3c5f82467ce2947c034305c688a0f6bfec9.tar.gz src-9ab2d3c5f82467ce2947c034305c688a0f6bfec9.zip |
lualoader: Use cli_execute_unparsed for commands passed in via loader.conf
This applies to:
- exec
- [module]_before
- [module]_error
- [module]_after
Before this commit, these used loader.perform to execute them as a pure,
unsalted loader command. This means that they were not able to take
advantage of any Lua-salted loader commands, like boot and autoboot, or pure
Lua loader commands (functions attached to the 'cli' module).
They now have access to the full arsenal, just shy of being able to execute
arbitrary Lua.
Notes
Notes:
svn path=/head/; revision=330620
Diffstat (limited to 'stand/lua/config.lua')
-rw-r--r-- | stand/lua/config.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/stand/lua/config.lua b/stand/lua/config.lua index fc3efb9a7e2e..0bbdde483bf7 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -109,7 +109,7 @@ local pattern_table = { { str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, _) - if loader.perform(k) ~= 0 then + if cli_execute_unparsed(k) ~= 0 then print(MSG_FAILEXEC:format(k)) end end, @@ -290,25 +290,25 @@ function config.loadmod(mod, silent) str = str .. k end if v.before ~= nil then - pstatus = loader.perform(v.before) == 0 + pstatus = cli_execute_unparsed(v.before) == 0 if not pstatus and not silent then print(MSG_FAILEXBEF:format(v.before, k)) end status = status and pstatus end - if loader.perform(str) ~= 0 then + if cli_execute_unparsed(str) ~= 0 then if not silent then print(MSG_FAILEXMOD:format(str)) end if v.error ~= nil then - loader.perform(v.error) + cli_execute_unparsed(v.error) end status = false end if v.after ~= nil then - pstatus = loader.perform(v.after) == 0 + pstatus = cli_execute_unparsed(v.after) == 0 if not pstatus and not silent then print(MSG_FAILEXAF:format(v.after, k)) end |