|
@ -44,8 +44,6 @@ |
|
|
-define(PROVIDER, install_deps). |
|
|
-define(PROVIDER, install_deps). |
|
|
-define(DEPS, [app_discovery]). |
|
|
-define(DEPS, [app_discovery]). |
|
|
|
|
|
|
|
|
-define(APP_NAME_INDEX, 2). |
|
|
|
|
|
|
|
|
|
|
|
-type src_dep() :: {atom(), {atom(), string(), string()}} |
|
|
-type src_dep() :: {atom(), {atom(), string(), string()}} |
|
|
| {atom(), string(), {atom(), string(), string()}}. |
|
|
| {atom(), string(), {atom(), string(), string()}}. |
|
|
-type pkg_dep() :: {atom(), binary()} | atom(). |
|
|
-type pkg_dep() :: {atom(), binary()} | atom(). |
|
@ -296,7 +294,7 @@ update_src_deps(Profile, Level, SrcDeps, PkgDeps, SrcApps, State, Upgrade, Seen, |
|
|
end |
|
|
end |
|
|
end, |
|
|
end, |
|
|
{[], PkgDeps, SrcApps, State, Seen, Locks}, |
|
|
{[], PkgDeps, SrcApps, State, Seen, Locks}, |
|
|
sort_deps(SrcDeps)) of |
|
|
|
|
|
|
|
|
rebar_utils:sort_deps(SrcDeps)) of |
|
|
{[], NewPkgDeps, NewSrcApps, State1, Seen1, _NewLocks} -> |
|
|
{[], NewPkgDeps, NewSrcApps, State1, Seen1, _NewLocks} -> |
|
|
{State1, NewSrcApps, NewPkgDeps, Seen1}; |
|
|
{State1, NewSrcApps, NewPkgDeps, Seen1}; |
|
|
{NewSrcDeps, NewPkgDeps, NewSrcApps, State1, Seen1, NewLocks} -> |
|
|
{NewSrcDeps, NewPkgDeps, NewSrcApps, State1, Seen1, NewLocks} -> |
|
@ -486,14 +484,6 @@ maybe_upgrade(AppInfo, AppDir, true, State) -> |
|
|
false |
|
|
false |
|
|
end. |
|
|
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(). |
|
|
-spec parse_goal(binary(), binary()) -> pkg_dep(). |
|
|
parse_goal(Name, Constraint) -> |
|
|
parse_goal(Name, Constraint) -> |
|
|
case re:run(Constraint, "([^\\d]*)(\\d.*)", [{capture, [1,2], binary}]) of |
|
|
case re:run(Constraint, "([^\\d]*)(\\d.*)", [{capture, [1,2], binary}]) of |
|
|