diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2014-12-06 16:29:44 +0000 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2014-12-06 16:29:44 +0000 |
commit | 6cfe28c954dc12f847a15a78b5fcf65154f0407a (patch) | |
tree | ec48e97f48e6aba4599df8163771cd6a32e0b812 /src | |
parent | d5907ad9b932feaf7fdf1cdbb4319226ef22ea78 (diff) |
Partial fix to circular deps (#40)
- Adding tests
- fixing use of set fetching to find repeated deps and prevent infinite
loops
On a circular loop rebar3 now fails with `{error, no_sort}`, which is
uncaught and should be handled to consider the issue fully fixed.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index a3ffc66..461baa5 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -151,7 +151,7 @@ update_pkg_deps(Pkgs, Packages, Update, Seen, State) -> ,Packages ,Pkg), {SeenAcc1, StateAcc1} = maybe_lock(AppInfo, SeenAcc, StateAcc), - case maybe_fetch(StateAcc1, AppInfo, Update, SeenAcc) of + case maybe_fetch(StateAcc1, AppInfo, Update, SeenAcc1) of true -> {[AppInfo | Acc], SeenAcc1, StateAcc1}; false -> @@ -167,7 +167,7 @@ maybe_lock(AppInfo, Seen, State) -> {sets:add_element(Name, Seen), rebar_state:lock(State, AppInfo)}; true -> - {sets:add_element(Name, Seen), State} + {Seen, State} end. package_to_app(DepsDir, Packages, {Name, Vsn}) -> @@ -204,7 +204,7 @@ update_src_deps(Level, SrcDeps, PkgDeps, SrcApps, State, Update, Seen) -> ,Level ,StateAcc1); _ -> - maybe_fetch(StateAcc, AppInfo, false, SeenAcc), + maybe_fetch(StateAcc, AppInfo, false, SeenAcc1), handle_dep(AppInfo ,SrcDepsAcc ,PkgDepsAcc |