mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 05:37:39 +03:00
package{,c}path fixes for migration tools
This commit is contained in:
parent
eb2837ec6d
commit
5554e15437
5 changed files with 34 additions and 5 deletions
|
@ -11,8 +11,10 @@
|
|||
|
||||
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.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
|
||||
end
|
||||
|
||||
local erlparse = require "erlparse";
|
||||
|
@ -229,10 +231,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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 = { };
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue