util.dependencies: Load luarocks.loader/luarocks.require
authorMatthew Wild <mwild1@gmail.com>
Thu, 28 Jan 2010 18:10:20 +0000 (18:10 +0000)
committerMatthew Wild <mwild1@gmail.com>
Thu, 28 Jan 2010 18:10:20 +0000 (18:10 +0000)
util/dependencies.lua

index 13f88f794104f73e039b3559c80f1fbfc58943cd..72a7cafe26b1614b64fa1c4ecc4fd53451f9588f 100644 (file)
@@ -10,6 +10,11 @@ module("dependencies", package.seeall)
 
 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("**************************");