diff options
author | David Reid <dreid@dreid.org> | 2010-03-04 23:50:57 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2010-03-04 23:50:57 -0800 |
commit | 92a5a326d5b8ff5e98e0991a090c30046a389fac (patch) | |
tree | ad8f29c0de1e88b11047db440f4d65b922846cd3 /src | |
parent | 56e30351f70dc9924ff873fc4fbb1e9738c807d2 (diff) |
Support downloading deps via SVN.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_deps.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 11c78d0..3bbc64c 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -203,15 +203,19 @@ download_source(AppDir, {hg, Url, Rev}) -> download_source(AppDir, {git, Url, Rev}) -> ok = filelib:ensure_dir(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, {svn, Url, Rev}) -> + ok = filelib:ensure_dir(AppDir), + rebar_utils:sh(?FMT("svn checkout -r ~s ~s ~s", + [Rev, Url, filename:basename(AppDir)]), [], + filename:dirname(AppDir)). %% =================================================================== %% Source helper functions %% =================================================================== -source_engine_avail({Name, _, _}) when Name == hg; Name == git -> +source_engine_avail({Name, _, _}) when Name == hg; Name == git; Name == svn -> case scm_client_vsn(Name) >= required_scm_client_vsn(Name) of true -> true; @@ -232,11 +236,14 @@ scm_client_vsn(Path, VsnArg, VsnRegex) -> end. 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(svn) -> {1, 6}. scm_client_vsn(hg) -> scm_client_vsn(os:find_executable(hg), " --version", "version (\\d+).(\\d+)"); scm_client_vsn(git) -> scm_client_vsn(os:find_executable(git), " --version", "git version (\\d+).(\\d+)"); +scm_client_vsn(svn) -> + scm_client_vsn(os:find_executable(svn), " --version", "svn, version (\\d+).(\\d+)"); scm_client_vsn(_) -> undefined. |