Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 01:52:42 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329689 - head/stand/lua
Message-ID:  <201802210152.w1L1qgmA019831@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Wed Feb 21 01:52:42 2018
New Revision: 329689
URL: https://svnweb.freebsd.org/changeset/base/329689

Log:
  lualoader: Output "Failed to parse" messages
  
  I can't find any good reason these aren't enabled, so enable them.
  
  The silent runs will only return false on actual parse errors, so it's ok to
  be loud about those failures.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Wed Feb 21 01:50:46 2018	(r329688)
+++ head/stand/lua/config.lua	Wed Feb 21 01:52:42 2018	(r329689)
@@ -423,17 +423,18 @@ function config.load(file)
 	end
 
 	if not config.parse(file) then
-		-- XXX TODO: Why is this commented out?
---		print("Failed to parse configuration: '" .. file .. "'")
+		print("Failed to parse configuration: '" .. file .. "'")
 	end
 
 	local f = loader.getenv("loader_conf_files")
 	if f ~= nil then
 		for name in f:gmatch("([%w%p]+)%s*") do
-			if not config.parse(name) then
-				-- XXX TODO: Ditto the above
---				print("Failed to parse configuration: '" ..
---				    name .. "'")
+			-- These may or may not exist, and that's ok. Do a
+			-- silent parse so that we complain on parse errors but
+			-- not for them simply not existing.
+			if not config.parse(name, true) then
+				print("Failed to parse configuration: '" ..
+				    name .. "'")
 			end
 		end
 	end



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802210152.w1L1qgmA019831>