summaryrefslogtreecommitdiff
path: root/src/rebar_prv_upgrade.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_upgrade.erl')
-rw-r--r--src/rebar_prv_upgrade.erl21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/rebar_prv_upgrade.erl b/src/rebar_prv_upgrade.erl
index 3a371ca..97d1953 100644
--- a/src/rebar_prv_upgrade.erl
+++ b/src/rebar_prv_upgrade.erl
@@ -53,18 +53,21 @@ do(State) ->
{Locks0, _Unlocks0} ->
Deps0 = top_level_deps(Deps, Locks),
State1 = rebar_state:set(State, {deps, default}, Deps0),
- State2 = rebar_state:set(State1, {locks, default}, Locks0),
- State3 = rebar_state:set(State2, upgrade, true),
- UpdatedLocks = [L || L <- rebar_state:lock(State3),
+ DepsDir = rebar_prv_install_deps:profile_dep_dir(State, default),
+ D = rebar_app_utils:parse_deps(root, DepsDir, Deps0, State1, Locks0, 0),
+ State2 = rebar_state:set(State1, {parsed_deps, default}, D),
+ State3 = rebar_state:set(State2, {locks, default}, Locks0),
+ State4 = rebar_state:set(State3, upgrade, true),
+ UpdatedLocks = [L || L <- rebar_state:lock(State4),
lists:keymember(rebar_app_info:name(L), 1, Locks0)],
- Res = rebar_prv_install_deps:do(rebar_state:lock(State3, UpdatedLocks)),
+ Res = rebar_prv_install_deps:do(rebar_state:lock(State4, UpdatedLocks)),
case Res of
- {ok, State4} ->
+ {ok, State5} ->
rebar_utils:info_useless(
[element(1,Lock) || Lock <- Locks],
- [rebar_app_info:name(App) || App <- rebar_state:lock(State4)]
+ [rebar_app_info:name(App) || App <- rebar_state:lock(State5)]
),
- rebar_prv_lock:do(State4);
+ rebar_prv_lock:do(State5);
_ ->
Res
end
@@ -80,7 +83,6 @@ format_error({transitive_dependency, Name}) ->
format_error(Reason) ->
io_lib:format("~p", [Reason]).
-
parse_names(Bin, Locks) ->
case lists:usort(re:split(Bin, <<" *, *">>, [trim])) of
%% Nothing submitted, use *all* apps
@@ -98,7 +100,8 @@ prepare_locks([Name|Names], Deps, Locks, Unlocks) ->
{_, _, 0} = Lock ->
case rebar_utils:tup_find(AtomName, Deps) of
false ->
- ?PRV_ERROR({unknown_dependency, Name});
+ ?WARN("Dependency ~s has been removed and will not be upgraded", [Name]),
+ prepare_locks(Names, Deps, Locks, Unlocks);
Dep ->
{Source, NewLocks, NewUnlocks} = prepare_lock(Dep, Lock, Locks),
prepare_locks(Names, Deps, NewLocks,