summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-12-05 20:19:18 -0600
committerTristan Sloughter <t@crashfast.com>2014-12-05 20:19:47 -0600
commitf5476e7200bc0185d376fb2e3bedd7289fd0f56d (patch)
tree89859762ff80854386cce93df14ddfb63e1da226 /src
parent91860340bb66d240f207eef1306778dde6fe3edc (diff)
if already seen dep before don't try handling it again
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_install_deps.erl49
1 files changed, 27 insertions, 22 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index ade0c81..a3ffc66 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -187,28 +187,33 @@ package_to_app(DepsDir, Packages, {Name, Vsn}) ->
update_src_deps(Level, SrcDeps, PkgDeps, SrcApps, State, Update, Seen) ->
case lists:foldl(fun(AppInfo, {SrcDepsAcc, PkgDepsAcc, SrcAppsAcc, StateAcc, SeenAcc}) ->
%% If not seen, add to list of locks to write out
- {SeenAcc1, StateAcc1} = maybe_lock(AppInfo, SeenAcc, StateAcc),
- {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2} =
- case Update of
- {true, UpdateName, UpdateLevel} ->
- handle_update(AppInfo
- ,UpdateName
- ,UpdateLevel
- ,SrcDepsAcc
- ,PkgDepsAcc
- ,SrcAppsAcc
- ,Level
- ,StateAcc1);
- _ ->
- maybe_fetch(StateAcc, AppInfo, false, SeenAcc),
- handle_dep(AppInfo
- ,SrcDepsAcc
- ,PkgDepsAcc
- ,SrcAppsAcc
- ,Level
- ,StateAcc1)
- end,
- {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2, SeenAcc1}
+ case sets:is_element(rebar_app_info:name(AppInfo), SeenAcc) of
+ true ->
+ {SrcDepsAcc, PkgDepsAcc, SrcAppsAcc, StateAcc, SeenAcc};
+ false ->
+ {SeenAcc1, StateAcc1} = maybe_lock(AppInfo, SeenAcc, StateAcc),
+ {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2} =
+ case Update of
+ {true, UpdateName, UpdateLevel} ->
+ handle_update(AppInfo
+ ,UpdateName
+ ,UpdateLevel
+ ,SrcDepsAcc
+ ,PkgDepsAcc
+ ,SrcAppsAcc
+ ,Level
+ ,StateAcc1);
+ _ ->
+ maybe_fetch(StateAcc, AppInfo, false, SeenAcc),
+ handle_dep(AppInfo
+ ,SrcDepsAcc
+ ,PkgDepsAcc
+ ,SrcAppsAcc
+ ,Level
+ ,StateAcc1)
+ end,
+ {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2, SeenAcc1}
+ end
end, {[], PkgDeps, SrcApps, State, Seen}, SrcDeps) of
{[], NewPkgDeps, NewSrcApps, State1, Seen1} ->
{State1, NewSrcApps, NewPkgDeps, Seen1};