Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 02:35:14 +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: r329692 - head/stand/lua
Message-ID:  <201802210235.w1L2ZEfG039759@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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