# HG changeset patch # User Matthew Wild # Date 1272029548 -3600 # Node ID 1eabe33d7af7b333389aa0cb1c77da68cfa991fa # Parent d9d0f9517ca0be6c965ecde386934871cb1d1f1f Support for LuaRocks (thanks albert!) diff -r d9d0f9517ca0 -r 1eabe33d7af7 xmpp-fingerprint.lua --- a/xmpp-fingerprint.lua Wed Apr 21 17:03:44 2010 +0100 +++ b/xmpp-fingerprint.lua Fri Apr 23 14:32:28 2010 +0100 @@ -1,6 +1,14 @@ #!/usr/bin/env lua -local socket = require "socket"; +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 + +local socket = softreq "socket"; -- Defaults -- default_port = 5222;