summaryrefslogtreecommitdiff
path: root/src/rebar_prv_upgrade.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-07-26 18:54:05 +0100
committerFred Hebert <mononcqc@ferd.ca>2015-07-26 18:54:05 +0100
commita415140415e4f48de85f754e10443745a72fad4f (patch)
treec3e08623fa2d1f18417563885be05acb1aa17083 /src/rebar_prv_upgrade.erl
parente2b4dcdb4c68c8142aba9835a5ee4c644aef4e9b (diff)
parente64671686fd3d6fbec3077de29c1f5efc059388b (diff)
Merge pull request #650 from tsloughter/upgrades_git_pkg_fix
fix upgrade of newly added pkg dep from scm locked dep
Diffstat (limited to 'src/rebar_prv_upgrade.erl')
-rw-r--r--src/rebar_prv_upgrade.erl13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/rebar_prv_upgrade.erl b/src/rebar_prv_upgrade.erl
index 49d5674..46aed9e 100644
--- a/src/rebar_prv_upgrade.erl
+++ b/src/rebar_prv_upgrade.erl
@@ -94,21 +94,16 @@ prepare_locks([Name|Names], Deps, Locks, Unlocks) ->
AtomName = binary_to_atom(Name, utf8),
case lists:keyfind(Name, 1, Locks) of
{_, _, 0} = Lock ->
- case {lists:keyfind(AtomName, 1, Deps), lists:member(AtomName, Deps)} of
- {false, false} ->
+ case rebar_utils:tup_find(AtomName, Deps) of
+ false ->
?PRV_ERROR({unknown_dependency, Name});
- {Dep, false} ->
- {Source, NewLocks, NewUnlocks} = prepare_lock(Dep, Lock, Locks),
- prepare_locks(Names, Deps, NewLocks,
- [{Name, Source, 0} | NewUnlocks ++ Unlocks]);
- {false, true} -> % package as a single atom
- Dep = AtomName,
+ Dep ->
{Source, NewLocks, NewUnlocks} = prepare_lock(Dep, Lock, Locks),
prepare_locks(Names, Deps, NewLocks,
[{Name, Source, 0} | NewUnlocks ++ Unlocks])
end;
{_, _, Level} = Lock when Level > 0 ->
- case lists:keyfind(AtomName, 1, Deps) of
+ case rebar_utils:tup_find(AtomName, Deps) of
false ->
?PRV_ERROR({transitive_dependency, Name});
Dep -> % Dep has been promoted