util.dependencies: Load luarocks.loader/luarocks.require

Thu, 28 Jan 2010 18:10:20 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 28 Jan 2010 18:10:20 +0000
changeset 2513
a8aa7616b154
parent 2512
d04b0eeeb954
child 2514
163b2aef5aff

util.dependencies: Load luarocks.loader/luarocks.require

util/dependencies.lua file | annotate | diff | comparison | revisions
--- a/util/dependencies.lua	Thu Jan 28 15:17:55 2010 +0000
+++ b/util/dependencies.lua	Thu Jan 28 18:10:20 2010 +0000
@@ -10,6 +10,11 @@
 
 function softreq(...) local ok, lib =  pcall(require, ...); if ok then return lib; else return nil, lib; end end
 
+-- Required to be able to find packages installed with luarocks
+if not softreq "luarocks.loader" then -- LuaRocks 2.x
+	softreq "luarocks.require"; -- LuaRocks <1.x
+end
+
 function missingdep(name, sources, msg)
 	print("");
 	print("**************************");

mercurial