Comparison

tools/ejabberd2prosody.lua @ 5989:5aaddafe0beb

package{,c}path fixes for migration tools
author Vadim Misbakh-Soloviov <mva@mva.name>
date Fri, 14 Jun 2013 15:15:05 +0700
parent 5310:bc60cad47397
child 5697:956df0f1cb70
comparison
equal deleted inserted replaced
5988:177f233b5211 5989:5aaddafe0beb
9 9
10 10
11 11
12 package.path = package.path ..";../?.lua"; 12 package.path = package.path ..";../?.lua";
13 13
14 if arg[0]:match("[/\\]") then 14 local my_name = arg[0];
15 package.path = package.path .. ";"..arg[0]:gsub("[^/\\]*$", "?.lua"); 15 if my_name:match("[/\\]") then
16 package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
17 package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
16 end 18 end
17 19
18 local erlparse = require "erlparse"; 20 local erlparse = require "erlparse";
19 21
20 prosody = {}; 22 prosody = {};
227 local arg = ...; 229 local arg = ...;
228 local help = "/? -? ? /h -h /help -help --help"; 230 local help = "/? -? ? /h -h /help -help --help";
229 if not arg or help:find(arg, 1, true) then 231 if not arg or help:find(arg, 1, true) then
230 print([[ejabberd db dump importer for Prosody 232 print([[ejabberd db dump importer for Prosody
231 233
232 Usage: ejabberd2prosody.lua filename.txt 234 Usage: ]]..my_name..[[ filename.txt
233 235
234 The file can be generated from ejabberd using: 236 The file can be generated from ejabberd using:
235 sudo ./bin/ejabberdctl dump filename.txt 237 sudo ejabberdctl dump filename.txt
236 238
237 Note: The path of ejabberdctl depends on your ejabberd installation, and ejabberd needs to be running for ejabberdctl to work.]]); 239 Note: The path of ejabberdctl depends on your ejabberd installation, and ejabberd needs to be running for ejabberdctl to work.]]);
238 os.exit(1); 240 os.exit(1);
239 end 241 end
240 local count = 0; 242 local count = 0;