diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2015-04-29 10:19:15 +0200 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2015-04-29 10:19:15 +0200 |
commit | 4440b03b8976da2041df6004c0e56b8273d83268 (patch) | |
tree | 30f1380fd8b5c51b3466dbc513ed4b62a75c2c02 /src | |
parent | Merge pull request #549 from joudinet/master (diff) |
Fix fetching from git@github url and allow compilation from ejabberd sources
Diffstat (limited to 'src')
-rw-r--r-- | src/ext_mod.erl | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ext_mod.erl b/src/ext_mod.erl index b2b426cec..35c2a78d7 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -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; |