r463 - in trunk: . scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jan 24 05:59:39 EST 2008


Author: icculus
Date: 2008-01-24 05:59:36 -0500 (Thu, 24 Jan 2008)
New Revision: 463

Modified:
   trunk/CMakeLists.txt
   trunk/lua_glue.c
   trunk/scripts/localization.lua
   trunk/scripts/mojosetup_mainline.lua
Log:
Don't let install happen if we want manifest support and there's no Lua parser.


Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2008-01-24 10:43:28 UTC (rev 462)
+++ trunk/CMakeLists.txt	2008-01-24 10:59:36 UTC (rev 463)
@@ -233,6 +233,9 @@
 #  it, but even that's not an unclimbable obstacle.
 # In reality, you probably want to keep the parser, though, unless you REALLY
 #  must save every single byte in the download.
+# YOU NEED THE PARSER IF YOU WANT MANIFESTS WRITTEN OUT.
+# YOU NEED THE PARSER IF YOU WANT THE UNINSTALLER TO WORK.
+# DON'T DISABLE THIS NOW IF YOU DON'T ABSOLUTELY HAVE TO.
 # BINARY SIZE += 19
 OPTION(MOJOSETUP_LUA_PARSER "Bigger binary but scripts don't need to be compiled." TRUE)
 IF(MOJOSETUP_LUA_PARSER)

Modified: trunk/lua_glue.c
===================================================================
--- trunk/lua_glue.c	2008-01-24 10:43:28 UTC (rev 462)
+++ trunk/lua_glue.c	2008-01-24 10:59:36 UTC (rev 463)
@@ -84,7 +84,7 @@
 {
     lua_pushnumber(L, x);
     lua_setfield(L, -2, sym);
-} // set_string
+} // set_number
 
 
 // Sets t[sym]=f, where t is on the top of the Lua stack.
@@ -93,9 +93,19 @@
 {
     lua_pushinteger(L, x);
     lua_setfield(L, -2, sym);
-} // set_string
+} // set_integer
 
+
+// Sets t[sym]=f, where t is on the top of the Lua stack.
 // !!! FIXME: why is this a different naming convention?
+static inline void set_boolean(lua_State *L, boolean x, const char *sym)
+{
+    lua_pushboolean(L, x);
+    lua_setfield(L, -2, sym);
+} // set_boolean
+
+
+// !!! FIXME: why is this a different naming convention?
 static inline void set_string_array(lua_State *L, int argc, const char **argv,
                                     const char *sym)
 {
@@ -1555,6 +1565,12 @@
     lua_Integer euid = MojoPlatform_geteuid();
     lua_Integer gid = MojoPlatform_getgid();
 
+    #if DISABLE_LUA_PARSER
+    const boolean luaparser = false;
+    #else
+    const boolean luaparser = true;
+    #endif
+
     if (locale == NULL) locale = xstrdup("???");
     if (ostype == NULL) ostype = xstrdup("???");
     if (osversion == NULL) osversion = xstrdup("???");
@@ -1616,6 +1632,7 @@
             set_string(luaState, homedir, "homedir");
             set_string(luaState, binarypath, "binarypath");
             set_string(luaState, GBaseArchivePath, "basearchivepath");
+            set_boolean(luaState, luaparser, "luaparser");
             set_integer(luaState, uid, "uid");
             set_integer(luaState, euid, "euid");
             set_integer(luaState, gid, "gid");

Modified: trunk/scripts/localization.lua
===================================================================
--- trunk/scripts/localization.lua	2008-01-24 10:43:28 UTC (rev 462)
+++ trunk/scripts/localization.lua	2008-01-24 10:59:36 UTC (rev 463)
@@ -294,6 +294,13 @@
     ["BUG: support_uninstall requires write_manifest"] = {
     };
 
+    -- This is shown if the config file wants us to add a manifest to the
+    --  files we write to disk, but didn't enable Lua parser support in the
+    --  binary (this is done through CMake when compiling the C code). This is
+    --  a bug the developer must fix before shipping her installer.
+    ["BUG: write_manifest requires Lua parser support"] = {
+    };
+
     -- This is a file's permissions. Programmers give these as strings, and
     --  if one isn't valid, the program will report this. So, on Unix, they
     --  might specify "0600" as a valid string, but "sdfksjdfk" wouldn't be

Modified: trunk/scripts/mojosetup_mainline.lua
===================================================================
--- trunk/scripts/mojosetup_mainline.lua	2008-01-24 10:43:28 UTC (rev 462)
+++ trunk/scripts/mojosetup_mainline.lua	2008-01-24 10:59:36 UTC (rev 463)
@@ -1023,6 +1023,11 @@
         MojoSetup.fatal(_("BUG: support_uninstall requires write_manifest"))
     end
 
+    -- Manifest support requires the Lua parser.
+    if (install.write_manifest) and (not MojoSetup.info.luaparser) then
+        MojoSetup.fatal(_("BUG: write_manifest requires Lua parser support"))
+    end
+
     -- This is to save us the trouble of a loop every time we have to
     --  find media by id...
     MojoSetup.media = {}




More information about the mojosetup-commits mailing list