svn commit: r329692 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Wed Feb 21 02:35:14 UTC 2018


Author: kevans
Date: Wed Feb 21 02:35:13 2018
New Revision: 329692
URL: https://svnweb.freebsd.org/changeset/base/329692

Log:
  lualoader: Bring in local.lua module if it exists
  
  Provide a way for out-of-tree users of lualoader to patch into the loader
  system without having to modify our distributed scripts.
  
  Do note that we can't really offer any API compatibility guarantees at this
  time due to the evolving nature of lualoader right now.
  
  This still has some utility as local modules may add commands at the loader
  prompt without relying heavily on lualoader features- this specific
  functionality is less likely to change without more careful consideration.
  
  Reviewed by:	cem (earlier version)
  Differential Revision:	https://reviews.freebsd.org/D14439

Modified:
  head/stand/lua/loader.lua

Modified: head/stand/lua/loader.lua
==============================================================================
--- head/stand/lua/loader.lua	Wed Feb 21 02:21:22 2018	(r329691)
+++ head/stand/lua/loader.lua	Wed Feb 21 02:35:13 2018	(r329692)
@@ -30,6 +30,13 @@
 local config = require("config")
 local menu = require("menu")
 local password = require("password")
+local local_module
+
+local result, errstr, errnoval = lfs.attributes("/boot/lua/local.lua")
+-- Effectively discard any errors; we'll just act if it succeeds.
+if result ~= nil then
+	local_module = require("local")
+end
 
 -- Declares a global function cli_execute that attempts to dispatch the
 -- arguments passed as a lua function. This gives lua a chance to intercept


More information about the svn-src-head mailing list