From owner-freebsd-bugs@freebsd.org Wed Apr 29 12:28:21 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67E702B2C6F for ; Wed, 29 Apr 2020 12:28:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49ByTx0NV8z48fl for ; Wed, 29 Apr 2020 12:28:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 0D07A2B2C6E; Wed, 29 Apr 2020 12:28:21 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CC7B2B2C6D for ; Wed, 29 Apr 2020 12:28:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ByTw6dfgz48fk for ; Wed, 29 Apr 2020 12:28:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF17E56AB for ; Wed, 29 Apr 2020 12:28:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 03TCSKTp017366 for ; Wed, 29 Apr 2020 12:28:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 03TCSKZi017365 for bugs@FreeBSD.org; Wed, 29 Apr 2020 12:28:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 244640] [Patch][Lua loader] Implement missing "read-conf" 4th command Date: Wed, 29 Apr 2020 12:28:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: loader, patch-ready X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: olivier.freebsd@free.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@freebsd.org X-Bugzilla-Flags: mfc-stable12? mfc-stable11? X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2020 12:28:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D244640 --- Comment #6 from Olivier Certner --- 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.=