+2012-04-06 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Initialise $LUA_PATH to locate mingw-get specific scripts.
+
+ * src/pkgexec.cpp (lua_path_init): New static inline function.
+ (pkgXmlNode::DispatchScript): Call it on first time invocation, per...
+ [lua_path_setup == false]: ...this static function local variable.
+
2012-04-01 Keith Marshall <keithmarshall@users.sourceforge.net>
Support installation of releases other than latest available.
static const char *action_key = "action";
static const char *normal_key = "normal";
+static inline __attribute__((__always_inline__)) bool init_lua_path()
+{
+ /* A one time initialisation hook, to ensure that the built-in Lua script
+ * interpreter will load scripts from the libexec directory associated with
+ * the running mingw-get.exe instance.
+ */
+ putenv( "LUA_PATH=!\\libexec\\mingw-get\\?.lua;!\\..\\libexec\\mingw-get\\?.lua" );
+ return true;
+}
+
int pkgXmlNode::DispatchScript
( int status, const char *context, const char *priority, pkgXmlNode *action )
{
*/
lua_State *interpreter = NULL;
static const char *priority_key = "precedence";
+ static bool lua_path_setup = false;
+
+ if( ! lua_path_setup )
+ /*
+ * The Lua script path hasn't been initialised yet; do it now!
+ */
+ lua_path_setup = init_lua_path();
while( action != NULL )
{