diff options
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index cc65d30..ca9344b 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -253,12 +253,11 @@ update_unseen_dep(AppInfo, Profile, Level, Deps, Apps, State, Upgrade, Seen, Loc handle_dep(State, Profile, DepsDir, AppInfo, Locks, Level) -> Profiles = rebar_state:current_profiles(State), Name = rebar_app_info:name(AppInfo), - Vsn = rebar_app_info:original_vsn(AppInfo), %% Deps may be under a sub project app, find it and use its state if so S = rebar_app_info:state(AppInfo), C = rebar_config:consult(rebar_app_info:dir(AppInfo)), - S1 = rebar_state:new(S, C, rebar_app_info:dir(AppInfo)), + S1 = rebar_state:new(S, C, AppInfo), S2 = rebar_state:apply_overrides(S1, Name), S3 = rebar_state:apply_profiles(S2, Profiles), @@ -273,17 +272,10 @@ handle_dep(State, Profile, DepsDir, AppInfo, Locks, Level) -> AppInfo1 = rebar_app_info:state(AppInfo, S5), %% Upgrade lock level to be the level the dep will have in this dep tree - case rebar_app_info:resource_type(AppInfo1) of - pkg -> - NewDeps = rebar_packages:deps(Name, Vsn, S5), - NewDeps1 = rebar_app_utils:parse_deps(Name, DepsDir, NewDeps, S5, Locks, Level+1), - {rebar_app_info:deps(AppInfo1, NewDeps), NewDeps1, State}; - _ -> - Deps = rebar_state:get(S5, {deps, default}, []), - AppInfo2 = rebar_app_info:deps(AppInfo1, rebar_state:deps_names(Deps)), - Deps1 = rebar_app_utils:parse_deps(Name, DepsDir, Deps, S5, Locks, Level+1), - {AppInfo2, Deps1, State} - end. + Deps = rebar_state:get(S5, {deps, default}, []), + AppInfo2 = rebar_app_info:deps(AppInfo1, rebar_state:deps_names(Deps)), + Deps1 = rebar_app_utils:parse_deps(Name, DepsDir, Deps, S5, Locks, Level+1), + {AppInfo2, Deps1, State}. -spec maybe_fetch(rebar_app_info:t(), atom(), boolean(), sets:set(binary()), rebar_state:t()) -> {boolean(), rebar_app_info:t()}. @@ -384,13 +376,15 @@ update_app_info(AppDir, AppInfo) -> end. copy_app_info(OldAppInfo, NewAppInfo) -> + Deps = rebar_app_info:deps(OldAppInfo), ResourceType = rebar_app_info:resource_type(OldAppInfo), Parent = rebar_app_info:parent(OldAppInfo), Source = rebar_app_info:source(OldAppInfo), - rebar_app_info:resource_type( - rebar_app_info:source( - rebar_app_info:parent(NewAppInfo, Parent), Source), ResourceType). + rebar_app_info:deps( + rebar_app_info:resource_type( + rebar_app_info:source( + rebar_app_info:parent(NewAppInfo, Parent), Source), ResourceType), Deps). maybe_upgrade(AppInfo, AppDir, Upgrade, State) -> Source = rebar_app_info:source(AppInfo), |