Revert "stand/lua: always allow overriding with local config files"

This reverts commit d3d0b73557. no mail
sent out, and the commit message was wrong.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh
2024-02-02 12:01:56 -07:00
parent 30f8cb812e
commit 5fdf01dbee
5 changed files with 10 additions and 69 deletions
+3 -12
View File
@@ -630,7 +630,8 @@ function config.readConf(file, loaded_files)
return
end
local top_level = next(loaded_files) == nil -- Are we the top-level readConf?
-- We'll process loader_conf_dirs at the top-level readConf
local load_conf_dirs = next(loaded_files) == nil
print("Loading " .. file)
-- The final value of loader_conf_files is not important, so just
@@ -655,7 +656,7 @@ function config.readConf(file, loaded_files)
end
end
if top_level then
if load_conf_dirs then
local loader_conf_dirs = getEnv("loader_conf_dirs")
-- If product_vars is set, it must be a list of environment variable names
@@ -681,7 +682,6 @@ function config.readConf(file, loaded_files)
end
end
-- Process "loader_conf_dirs" extra-directories
if loader_conf_dirs ~= nil then
for name in loader_conf_dirs:gmatch("[%w%p]+") do
if lfs.attributes(name, "mode") ~= "directory" then
@@ -700,15 +700,6 @@ function config.readConf(file, loaded_files)
::nextdir::
end
end
-- Always allow overriding with local config files, e.g.,
-- /boot/loader.conf.local.
local local_loader_conf_files = getEnv("local_loader_conf_files")
if local_loader_conf_files then
for name in local_loader_conf_files:gmatch("[%w%p]+") do
config.readConf(name, loaded_files)
end
end
end
end
+2 -6
View File
@@ -64,13 +64,9 @@ as a configuration file
.Po e.g., as
.Pa loader.conf
.Pc
and then process files listed in the
and then processing files listed in
.Ev loader_conf_files
variable. Additionnaly, the top-level call to readConf will process files listed in the
.Ev loader_conf_dirs
and
.Ev local_loader_conf_files
variables
variable
.Po see
.Xr loader.conf 5
.Pc .