diff options
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 61fbd70..8db4761 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -44,8 +44,6 @@ -define(PROVIDER, install_deps). -define(DEPS, [app_discovery]). --define(APP_NAME_INDEX, 2). - -type src_dep() :: {atom(), {atom(), string(), string()}} | {atom(), string(), {atom(), string(), string()}}. -type pkg_dep() :: {atom(), binary()} | atom(). @@ -267,7 +265,7 @@ update_src_deps(Profile, Level, SrcDeps, PkgDeps, SrcApps, State, Upgrade, Seen, ,StateAcc ,LocksAcc), - {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2, SeenAcc, LocksAcc1} + {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2, SeenAcc, LocksAcc1} end; false -> {SeenAcc1, StateAcc1} = maybe_lock(Profile, AppInfo, SeenAcc, StateAcc, Level), @@ -296,7 +294,7 @@ update_src_deps(Profile, Level, SrcDeps, PkgDeps, SrcApps, State, Upgrade, Seen, end end, {[], PkgDeps, SrcApps, State, Seen, Locks}, - sort_deps(SrcDeps)) of + rebar_utils:sort_deps(SrcDeps)) of {[], NewPkgDeps, NewSrcApps, State1, Seen1, _NewLocks} -> {State1, NewSrcApps, NewPkgDeps, Seen1}; {NewSrcDeps, NewPkgDeps, NewSrcApps, State1, Seen1, NewLocks} -> @@ -486,14 +484,6 @@ maybe_upgrade(AppInfo, AppDir, true, State) -> false end. -sort_deps(Deps) -> - %% We need a sort stable, based on the name. So that for multiple deps on - %% the same level with the same name, we keep the order the parents had. - %% `lists:keysort/2' is documented as stable in the stdlib. - %% The list of deps is revered when we get it. For the proper stable - %% result, re-reverse it. - lists:keysort(?APP_NAME_INDEX, lists:reverse(Deps)). - -spec parse_goal(binary(), binary()) -> pkg_dep(). parse_goal(Name, Constraint) -> case re:run(Constraint, "([^\\d]*)(\\d.*)", [{capture, [1,2], binary}]) of |