xmpp-fingerprint.lua

changeset 2
1eabe33d7af7
parent 0
ba1cc6ad649d
child 3
fb9987d6df5d
--- 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;

mercurial