diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-02 19:04:03 -0600 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-02 19:04:03 -0600 |
commit | baf46a861b18086131707d056ee106c9fba8da3d (patch) | |
tree | c0bc1de343e52f8385d9f1740e32df5e85dfa234 /src/rebar_prv_install_deps.erl | |
parent | 8affde1c37ba746df41343a52fd8e239ebfe2db3 (diff) | |
parent | af0f4bb20a66f1464fa25d31f9b69784f3119493 (diff) |
Merge pull request #187 from tsloughter/profiles_dir
make base_dir for a run include the profiles in path, link to shared dep
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index ab4cca1..f702936 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -374,7 +374,15 @@ maybe_fetch(AppInfo, Upgrade, Seen, State) -> false -> case rebar_app_discover:find_app(AppDir, all) of false -> - fetch_app(AppInfo, AppDir, State); + case in_default(AppInfo, State) of + false -> + fetch_app(AppInfo, AppDir, State); + {true, FoundApp} -> + ?INFO("Linking ~s to ~s", [rebar_app_info:dir(FoundApp), AppDir]), + filelib:ensure_dir(AppDir), + rebar_file_utils:symlink_or_copy(rebar_app_info:dir(FoundApp), AppDir), + true + end; {true, _} -> case sets:is_element(rebar_app_info:name(AppInfo), Seen) of true -> @@ -392,6 +400,10 @@ in_checkouts(AppInfo) -> error -> false end. +in_default(AppInfo, State) -> + Name = ec_cnv:to_list(rebar_app_info:name(AppInfo)), + DefaultAppDir = filename:join([rebar_state:get(State, base_dir), "default", "lib", Name]), + rebar_app_discover:find_app(DefaultAppDir, all). -spec parse_deps(binary(), list(), list(), list(), integer()) -> {[rebar_app_info:t()], [pkg_dep()]}. parse_deps(DepsDir, Deps, State, Locks, Level) -> |