# HG changeset patch # User Matthew Wild # Date 1302010688 -3600 # Node ID 8973653feb35e23ea56bbb8363e3998a5b82c1dd # Parent 05f991b4a90e5bee34d57fa729cf39f6f9b64b85# Parent fad4a24f10bccc2a073f0ffa1efeb91af2b08626 Merge 0.8 -> trunk diff -r 05f991b4a90e -r 8973653feb35 .hgtags --- a/.hgtags Tue Apr 05 13:26:43 2011 +0100 +++ b/.hgtags Tue Apr 05 14:38:08 2011 +0100 @@ -40,3 +40,4 @@ ea80531e5cbc567c3e211d38749c45e8b66d33b7 0.7.0 ea80531e5cbc567c3e211d38749c45e8b66d33b7 0.7.0 5ea90ee96022b9c106e7e79b4a1d8b2ee99d45dc 0.7.0 +49b9e73e31ef38ff1c0141a83f897b5837c40d83 0.8.0 diff -r 05f991b4a90e -r 8973653feb35 tools/migration/migrator/prosody_files.lua --- a/tools/migration/migrator/prosody_files.lua Tue Apr 05 13:26:43 2011 +0100 +++ b/tools/migration/migrator/prosody_files.lua Tue Apr 05 14:38:08 2011 +0100 @@ -13,6 +13,7 @@ local next = next; local pairs = pairs; local json = require "util.json"; +local os_getenv = os.getenv; prosody = {}; local dm = require "util.datamanager" @@ -22,7 +23,7 @@ local function is_dir(path) return lfs.attributes(path, "mode") == "directory"; end local function is_file(path) return lfs.attributes(path, "mode") == "file"; end local function clean_path(path) - return path:gsub("\\", "/"):gsub("//+", "/"); + return path:gsub("\\", "/"):gsub("//+", "/"):gsub("^~", os_getenv("HOME") or "~"); end local encode, decode; do local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end }); diff -r 05f991b4a90e -r 8973653feb35 tools/migration/prosody-migrator.lua --- a/tools/migration/prosody-migrator.lua Tue Apr 05 13:26:43 2011 +0100 +++ b/tools/migration/prosody-migrator.lua Tue Apr 05 14:38:08 2011 +0100 @@ -3,6 +3,15 @@ CFG_SOURCEDIR=os.getenv("PROSODY_SRCDIR"); CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR"); +-- Substitute ~ with path to home directory in paths +if CFG_CONFIGDIR then + CFG_CONFIGDIR = CFG_CONFIGDIR:gsub("^~", os.getenv("HOME")); +end + +if CFG_SOURCEDIR then + CFG_SOURCEDIR = CFG_SOURCEDIR:gsub("^~", os.getenv("HOME")); +end + local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua"; -- Command-line parsing @@ -116,9 +125,10 @@ local json = require "util.json"; +io.stderr:write("Migrating...\n"); for x in reader do --print(json.encode(x)) writer(x); end writer(nil); -- close - +io.stderr:write("Done!\n");