lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


  I've successfully packaged up LuaRocks in a LEM file:

          _LEM      MIT       Lua 5.1-5.2   0.1      _LEM
                    MIT       Lua 5.1-5.2   2.1      _APP/luarocks
                    MIT       Lua 5.1-5.2   2.1      _APP/luarocks-admin
                    MIT       Lua 5.1-5.2   2.1      _MODULES/luarocks.add

		...

                    MIT       Lua 5.1-5.2   2.1      _MODULES/luarocks.unpack
                    MIT       Lua 5.1-5.2   2.1      _MODULES/luarocks.util
                    MIT       Lua 5.1-5.2   2.1      _MODULES/luarocks.validate
                    MIT       Lua 5.1-5.2   2.1      _MODULES/luarocks.write_rockspec
                                                     _FILES/config-5.1.lua
                                                     _FILES/config.lua

and you can tell I changed the layout a bit.  I've put application specific
files under _APP/, the modules themselves under _MODULES/ and files the
application uses under _FILES/.  The _APP files and _MODULES/ are loaded
directly from the LEM (seeing how they're all Lua scripts) which was the
original intent [1].  And I can run it from there:

[spc]lucy:~/projects/LEM>./tstlem.lua luarocks.lem luarocks list

Installed rocks:
----------------

date
   2.1.0-2 (installed) - /home/spc/.luarocks/lib/luarocks/rocks

lpeg
   0.12-1 (installed) - /home/spc/.luarocks/lib/luarocks/rocks

luarocks
   2.1.2-1 (installed) - /home/spc/.luarocks/lib/luarocks/rocks

luuid
   20120501-1 (installed) - /home/spc/.luarocks/lib/luarocks/rocks

org.conman.uuid
   1.2.0-1 (installed) - /home/spc/.luarocks/lib/luarocks/rocks

uuid
   0.2-1 (installed) - /home/spc/.luarocks/lib/luarocks/rocks

But there are still issues.  One, I can't serve up the files from the LEM
file---I have to write those out.  It's not enough to simply monkeypatch
io.open()---there's dofile() and loadfile() as well (found that out the hard
way).  And I'm not sure if I want to exactly monkeypatch Lua.  One problem:
what if LuaRocks did [2]:

	f = io.open("config.lua","r+")

which opens f in read/write mode.  Does that imply the file is updated in
the LEM file?  It's compressed in the LEM.  That means f:seek() won't work,
unless we inflate it, which either means we keep the entire file in memory,
or we inflate it to disk.  Right now I'm inflating everything under _FILES
to a temporary directory, then removing that after the program finishes [3].

And that leads to issue two:  persistent data.  In the LEM?  On disk? 
Depends on the app?  

Issue three: version numbers.  The actual version of LuaRocks I am using is 2.1.2-1. 
Is just using 2.1 good enough?  Do we need three numbers?  Four?  What do
they all mean?  

Issue four:  Aside from Aaron B, Kevin Martin and Lorenzo Donati, is there
anyone else intereted in a Lua application distribution file format?

  -spc (What else have people done to distribute Lua applications?)

[1]	Except for modules in C.  They have to be written to disk, then
	loaded using package.loadlib(), because there isn't an easy way to
	load shared objects directly from memory.

[2]	I'm not saying it does.  I'm just using it as an example since we've
	already mentioned it.

[3]	I could have really used an os.atexit() call.  I'm surprised it's
	not available.