Mercurial > prosody-hg
comparison util/dependencies.lua @ 409:2269e9cbe153
Add MD5 to the list of checked dependencies
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 25 Nov 2008 02:30:25 +0000 |
| parents | eb1a0960cefb |
| children | 5ce6801ad2e4 |
comparison
equal
deleted
inserted
replaced
| 408:eb1a0960cefb | 409:2269e9cbe153 |
|---|---|
| 1 local fatal; | 1 local fatal; |
| 2 | 2 |
| 3 local function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil; end end | 3 local function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil; end end |
| 4 | 4 |
| 5 local function missingdep(name, sources, msg) | 5 local function missingdep(name, sources, msg) |
| 6 print(""); | |
| 7 print("**************************"); | |
| 6 print("Prosody was unable to find "..tostring(name)); | 8 print("Prosody was unable to find "..tostring(name)); |
| 7 print("This package can be obtained in the following ways:"); | 9 print("This package can be obtained in the following ways:"); |
| 8 print(""); | 10 print(""); |
| 9 for k,v in pairs(sources) do | 11 for k,v in pairs(sources) do |
| 10 print("", k, v); | 12 print("", k, v); |
| 11 end | 13 end |
| 12 print(msg or (name.." is required for Prosody to run, so we will now exit.")); | 14 print(msg or (name.." is required for Prosody to run, so we will now exit.")); |
| 15 print("More help can be found on our website, at http://.../doc/depends"); | |
| 16 print("**************************"); | |
| 17 print(""); | |
| 13 end | 18 end |
| 14 | 19 |
| 15 local lxp = softreq "lxp" | 20 local lxp = softreq "lxp" |
| 16 | 21 |
| 17 if not lxp then | 22 if not lxp then |
| 30 | 35 |
| 31 if not ssl then | 36 if not ssl then |
| 32 missingdep("LuaSec", { ["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/" }, "SSL/TLS support will not be available"); | 37 missingdep("LuaSec", { ["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/" }, "SSL/TLS support will not be available"); |
| 33 end | 38 end |
| 34 | 39 |
| 40 | |
| 41 local md5 = softreq "md5"; | |
| 42 | |
| 43 if not md5 then | |
| 44 missingdep("MD5", { ["luarocks"] = "luarocks install md5"; ["Source"] = "http://luaforge.net/frs/?group_id=155" }); | |
| 45 fatal = true; | |
| 46 end | |
| 47 | |
| 48 | |
| 35 if fatal then os.exit(1); end | 49 if fatal then os.exit(1); end |
