diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-16 13:05:13 -0500 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-16 13:05:13 -0500 |
commit | fb6151b524c0c43957d01c5fa8ba3d42044e2d1d (patch) | |
tree | bab5dfbf7fd01205497f182ac398352bd8912efa /src/rebar_app_discover.erl | |
parent | 9d4ed68620b52d5b96e4bc3c4ebc8735a5df2782 (diff) | |
parent | f35f26fece0bc3843bd4dba9244ae974fd84d9e1 (diff) |
Merge pull request #269 from ferd/dep-conflict-as-error
Dep conflict as error
Diffstat (limited to 'src/rebar_app_discover.erl')
-rw-r--r-- | src/rebar_app_discover.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl index 63cf703..0799313 100644 --- a/src/rebar_app_discover.erl +++ b/src/rebar_app_discover.erl @@ -48,7 +48,9 @@ merge_deps(AppInfo, State) -> State1 = lists:foldl(fun(Profile, StateAcc) -> AppProfDeps = rebar_state:get(AppState, {deps, Profile}, []), TopLevelProfDeps = rebar_state:get(StateAcc, {deps, Profile}, []), - ProfDeps2 = lists:keymerge(1, TopLevelProfDeps, AppProfDeps), + ProfDeps2 = dedup(lists:keymerge(1, + lists:keysort(1, TopLevelProfDeps), + lists:keysort(1, AppProfDeps))), rebar_state:set(StateAcc, {deps, Profile}, ProfDeps2) end, State, lists:reverse(CurrentProfiles)), @@ -166,3 +168,8 @@ create_app_info(AppDir, AppFile) -> _ -> error end. + +dedup([]) -> []; +dedup([A]) -> [A]; +dedup([H,H|T]) -> dedup([H|T]); +dedup([H|T]) -> [H|dedup(T)]. |