Mercurial > prosody-hg
comparison util/dependencies.lua @ 2513:a8aa7616b154
util.dependencies: Load luarocks.loader/luarocks.require
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 28 Jan 2010 18:10:20 +0000 |
| parents | 97b5ea975cb9 |
| children | f321211978f6 |
comparison
equal
deleted
inserted
replaced
| 2512:d04b0eeeb954 | 2513:a8aa7616b154 |
|---|---|
| 7 -- | 7 -- |
| 8 | 8 |
| 9 module("dependencies", package.seeall) | 9 module("dependencies", package.seeall) |
| 10 | 10 |
| 11 function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil, lib; end end | 11 function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil, lib; end end |
| 12 | |
| 13 -- Required to be able to find packages installed with luarocks | |
| 14 if not softreq "luarocks.loader" then -- LuaRocks 2.x | |
| 15 softreq "luarocks.require"; -- LuaRocks <1.x | |
| 16 end | |
| 12 | 17 |
| 13 function missingdep(name, sources, msg) | 18 function missingdep(name, sources, msg) |
| 14 print(""); | 19 print(""); |
| 15 print("**************************"); | 20 print("**************************"); |
| 16 print("Prosody was unable to find "..tostring(name)); | 21 print("Prosody was unable to find "..tostring(name)); |
