aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-06-29 14:45:47 +0100
committerMatthew Wild <mwild1@gmail.com>2013-06-29 14:45:47 +0100
commit2489f372db5f8d584c537ba31844cdaf8fd19b10 (patch)
tree27741db74d498be76001287c8a4e6a9076bb5a27 /tools
parent5adcad1a43d110e0458b38c42b0a21a70eb5336e (diff)
parent82bd1a5967eba247d95ddde8d8d77197b2bada91 (diff)
downloadprosody-2489f372db5f8d584c537ba31844cdaf8fd19b10.tar.gz
prosody-2489f372db5f8d584c537ba31844cdaf8fd19b10.zip
Merge
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ejabberd2prosody.lua11
-rw-r--r--tools/ejabberdsql2prosody.lua8
-rw-r--r--tools/jabberd14sql2prosody.lua9
-rw-r--r--tools/openfire2prosody.lua6
-rwxr-xr-xtools/xep227toprosody.lua6
5 files changed, 35 insertions, 5 deletions
diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua
index c11e41d9..ff3004c2 100755
--- a/tools/ejabberd2prosody.lua
+++ b/tools/ejabberd2prosody.lua
@@ -11,8 +11,11 @@
package.path = package.path ..";../?.lua";
-if arg[0]:match("[/\\]") then
- package.path = package.path .. ";"..arg[0]:gsub("[^/\\]*$", "?.lua");
+local my_name = arg[0];
+if my_name:match("[/\\]") then
+ package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
+ package.path = package.path..";"..my_name:gsub("[^/\\]+$", "?.lua");
+ package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
end
local erlparse = require "erlparse";
@@ -229,10 +232,10 @@ local help = "/? -? ? /h -h /help -help --help";
if not arg or help:find(arg, 1, true) then
print([[ejabberd db dump importer for Prosody
- Usage: ejabberd2prosody.lua filename.txt
+ Usage: ]]..my_name..[[ filename.txt
The file can be generated from ejabberd using:
- sudo ./bin/ejabberdctl dump filename.txt
+ sudo ejabberdctl dump filename.txt
Note: The path of ejabberdctl depends on your ejabberd installation, and ejabberd needs to be running for ejabberdctl to work.]]);
os.exit(1);
diff --git a/tools/ejabberdsql2prosody.lua b/tools/ejabberdsql2prosody.lua
index 43720643..d80b9e46 100644
--- a/tools/ejabberdsql2prosody.lua
+++ b/tools/ejabberdsql2prosody.lua
@@ -10,6 +10,14 @@
prosody = {};
package.path = package.path ..";../?.lua";
+
+local my_name = arg[0];
+if my_name:match("[/\\]") then
+ package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
+ package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
+end
+
+
local serialize = require "util.serialization".serialize;
local st = require "util.stanza";
local parse_xml = require "util.xml".parse;
diff --git a/tools/jabberd14sql2prosody.lua b/tools/jabberd14sql2prosody.lua
index b85d2c20..d6a6753f 100644
--- a/tools/jabberd14sql2prosody.lua
+++ b/tools/jabberd14sql2prosody.lua
@@ -428,7 +428,14 @@ end
end
-- import modules
-package.path = [[C:\Documents and Settings\Waqas\Desktop\mercurial\prosody-hg\?.lua;]]..package.path;
+package.path = package.path.."..\?.lua;";
+
+local my_name = arg[0];
+if my_name:match("[/\\]") then
+ package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
+ package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
+end
+
-- ugly workaround for getting datamanager to work outside of prosody :(
prosody = { };
diff --git a/tools/openfire2prosody.lua b/tools/openfire2prosody.lua
index bdea9a63..5ef47602 100644
--- a/tools/openfire2prosody.lua
+++ b/tools/openfire2prosody.lua
@@ -9,6 +9,12 @@
package.path = package.path..";../?.lua";
package.cpath = package.cpath..";../?.so"; -- needed for util.pposix used in datamanager
+local my_name = arg[0];
+if my_name:match("[/\\]") then
+ package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
+ package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
+end
+
-- ugly workaround for getting datamanager to work outside of prosody :(
prosody = { };
prosody.platform = "unknown";
diff --git a/tools/xep227toprosody.lua b/tools/xep227toprosody.lua
index b5156f45..0862b0c1 100755
--- a/tools/xep227toprosody.lua
+++ b/tools/xep227toprosody.lua
@@ -25,6 +25,12 @@
package.path = package.path..";../?.lua";
package.cpath = package.cpath..";../?.so"; -- needed for util.pposix used in datamanager
+local my_name = arg[0];
+if my_name:match("[/\\]") then
+ package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
+ package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
+end
+
-- ugly workaround for getting datamanager to work outside of prosody :(
prosody = { };
prosody.platform = "unknown";