Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2020 12:28:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 244640] [Patch][Lua loader] Implement missing "read-conf" 4th command
Message-ID:  <bug-244640-227-KrGYxPuQmE@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-244640-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-244640-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D244640

--- Comment #6 from Olivier Certner <olivier.freebsd@free.fr> ---
Created attachment 213909
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D213909&action=
=3Dedit
Replace "readConfFiles" by "readConf", simplifications, fix corner case

The corner case I spotted is that some "read-conf" issued after
"loader_conf_files" has been set fails to reload these files if the initial
file to read contains "loader_conf_files" with the same list.

I first tried to solve it by temporarily removing "loader_conf_files" from =
the
environment before loading any file and then checking if it was set in the
meantime. This approach works but has two (arguably minor) problems: each
processed file cannot itself on the previous value of "loader_conf_files", =
and
this causes lots of calls to setenv/unsetenv/getenv (don't know if this is
really a problem, but some comments made me think it could).

So I settled for another approach, which doesn't have any of these drawback=
s.
Instead, it depends on the use of "env_changed" (and the fact that parsing a
configuration file sets environment variables through "setEnv").

I've replaced readConfFiles by a simple readConf (which still can be passed=
 the
"loaded_files" map, but this is not used internally; the argument could be
removed), which is used by "config.load" as well as "read-conf" straight.

What do you think?

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-244640-227-KrGYxPuQmE>