util.dependencies: Load luarocks.loader/luarocks.require
authorMatthew Wild <mwild1@gmail.com>
Thu, 28 Jan 2010 18:10:20 +0000
changeset 2797 76777fee99b7
parent 2796 1e287badd033
child 2798 2702ee68727d
util.dependencies: Load luarocks.loader/luarocks.require
prosody
--- a/prosody	Wed Jan 13 00:04:38 2010 +0000
+++ b/prosody	Thu Jan 28 18:10:20 2010 +0000
@@ -31,7 +31,9 @@
 end
 
 -- Required to be able to find packages installed with luarocks
-pcall(require, "luarocks.require")
+if not pcall(require, "luarocks.loader") then -- Try LuaRocks 2.x
+	pcall(require, "luarocks.require") -- Try LuaRocks 1.x
+end
 
 -- Replace require with one that doesn't pollute _G
 do