24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-22 22:23:42 +02:00

Fix fetching from git@github url and allow compilation from ejabberd sources

This commit is contained in:
Christophe Romain 2015-04-29 10:19:15 +02:00
parent 01718a4e42
commit 4440b03b89

View File

@ -302,7 +302,15 @@ extract_url(Path, DestDir) ->
++[{error, unsupported_source}]).
extract_github_master(Repos, DestDir) ->
case extract(zip, geturl(Repos ++ "/archive/master.zip"), DestDir) of
Base = case string:tokens(Repos, ":") of
["git@github.com", T1] -> "https://github.com/"++T1;
_ -> Repos
end,
Url = case lists:reverse(Base) of
[$t,$i,$g,$.|T2] -> lists:reverse(T2);
_ -> Base
end,
case extract(zip, geturl(Url++"/archive/master.zip"), DestDir) of
ok ->
RepDir = filename:join(DestDir, module_name(Repos)),
file:rename(RepDir++"-master", RepDir);
@ -445,10 +453,13 @@ compile(_Module, _Spec, DestDir) ->
{file, _} -> [{d, 'LAGER'}];
_ -> []
end,
ExtLib = case filelib:is_file(filename:join(EjabInc, "xml.hrl")) of
true -> [{d, 'NO_EXT_LIB'}]; %% use include instead of include_lib
false -> []
end,
Options = [{outdir, Ebin}, {i, "include"}, {i, EjabInc},
{d, 'NO_EXT_LIB'}, %% use include instead of include_lib
verbose, report_errors, report_warnings]
++ Logger,
++ Logger ++ ExtLib,
Result = [case compile:file(File, Options) of
{ok, _} -> ok;
{ok, _, _} -> ok;