mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Support for downloading deps via bzr.
This commit is contained in:
parent
92a5a326d5
commit
a29da71aac
1 changed files with 10 additions and 1 deletions
|
@ -204,6 +204,11 @@ download_source(AppDir, {git, Url, Rev}) ->
|
||||||
ok = filelib:ensure_dir(AppDir),
|
ok = filelib:ensure_dir(AppDir),
|
||||||
rebar_utils:sh(?FMT("git clone -n ~s", [Url]), [], filename:dirname(AppDir)),
|
rebar_utils:sh(?FMT("git clone -n ~s", [Url]), [], filename:dirname(AppDir)),
|
||||||
rebar_utils:sh(?FMT("git checkout ~s", [Rev]), [], AppDir);
|
rebar_utils:sh(?FMT("git checkout ~s", [Rev]), [], AppDir);
|
||||||
|
download_source(AppDir, {bzr, Url, Rev}) ->
|
||||||
|
ok = filelib:ensure_dir(AppDir),
|
||||||
|
rebar_utils:sh(?FMT("bzr branch -r ~s ~s ~s",
|
||||||
|
[Rev, Url, filename:basename(AppDir)]), [],
|
||||||
|
filename:dirname(AppDir));
|
||||||
download_source(AppDir, {svn, Url, Rev}) ->
|
download_source(AppDir, {svn, Url, Rev}) ->
|
||||||
ok = filelib:ensure_dir(AppDir),
|
ok = filelib:ensure_dir(AppDir),
|
||||||
rebar_utils:sh(?FMT("svn checkout -r ~s ~s ~s",
|
rebar_utils:sh(?FMT("svn checkout -r ~s ~s ~s",
|
||||||
|
@ -215,7 +220,8 @@ download_source(AppDir, {svn, Url, Rev}) ->
|
||||||
%% Source helper functions
|
%% Source helper functions
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
|
|
||||||
source_engine_avail({Name, _, _}) when Name == hg; Name == git; Name == svn ->
|
source_engine_avail({Name, _, _})
|
||||||
|
when Name == hg; Name == git; Name == svn; Name == bzr ->
|
||||||
case scm_client_vsn(Name) >= required_scm_client_vsn(Name) of
|
case scm_client_vsn(Name) >= required_scm_client_vsn(Name) of
|
||||||
true ->
|
true ->
|
||||||
true;
|
true;
|
||||||
|
@ -237,12 +243,15 @@ scm_client_vsn(Path, VsnArg, VsnRegex) ->
|
||||||
|
|
||||||
required_scm_client_vsn(hg) -> {1, 4};
|
required_scm_client_vsn(hg) -> {1, 4};
|
||||||
required_scm_client_vsn(git) -> {1, 6};
|
required_scm_client_vsn(git) -> {1, 6};
|
||||||
|
required_scm_client_vsn(bzr) -> {2, 0};
|
||||||
required_scm_client_vsn(svn) -> {1, 6}.
|
required_scm_client_vsn(svn) -> {1, 6}.
|
||||||
|
|
||||||
scm_client_vsn(hg) ->
|
scm_client_vsn(hg) ->
|
||||||
scm_client_vsn(os:find_executable(hg), " --version", "version (\\d+).(\\d+)");
|
scm_client_vsn(os:find_executable(hg), " --version", "version (\\d+).(\\d+)");
|
||||||
scm_client_vsn(git) ->
|
scm_client_vsn(git) ->
|
||||||
scm_client_vsn(os:find_executable(git), " --version", "git version (\\d+).(\\d+)");
|
scm_client_vsn(os:find_executable(git), " --version", "git version (\\d+).(\\d+)");
|
||||||
|
scm_client_vsn(bzr) ->
|
||||||
|
scm_client_vsn(os:find_executable(bzr), " --version", "Bazaar \\(bzr\\) (\\d+).(\\d+)");
|
||||||
scm_client_vsn(svn) ->
|
scm_client_vsn(svn) ->
|
||||||
scm_client_vsn(os:find_executable(svn), " --version", "svn, version (\\d+).(\\d+)");
|
scm_client_vsn(os:find_executable(svn), " --version", "svn, version (\\d+).(\\d+)");
|
||||||
scm_client_vsn(_) ->
|
scm_client_vsn(_) ->
|
||||||
|
|
Loading…
Reference in a new issue