diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-02-19 09:21:15 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-02-19 09:21:15 -0500 |
commit | c3cdecf1252fe51caa7b9aeb0e1f77bd735c0131 (patch) | |
tree | adfcdacac38b87d7612a5757d0efd8d443d285cd /src/rebar_prv_install_deps.erl | |
parent | f203bc3c4fa1727315b96ff0ec4501e35a64e30b (diff) | |
parent | 8874e414a80f7f29e3a8c8f00b3887399a7a6cbc (diff) |
Merge pull request #160 from tsloughter/sub_deps
use project sub-apps with deps in their rebar.config
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 |