diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2014-12-05 21:23:44 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2014-12-05 21:23:44 -0500 |
commit | d5907ad9b932feaf7fdf1cdbb4319226ef22ea78 (patch) | |
tree | 89859762ff80854386cce93df14ddfb63e1da226 | |
parent | 018c5ceba35c3af4af9b38f614e4530a2ce99db4 (diff) | |
parent | f5476e7200bc0185d376fb2e3bedd7289fd0f56d (diff) |
Merge pull request #43 from tsloughter/seen
if already seen dep before don't try handling it again
-rw-r--r-- | src/rebar_prv_install_deps.erl | 49 |
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}; |