summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-22 15:15:36 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-22 18:12:26 -0500
commitf772dcee2e7082f3da4520043de888d5d68aa750 (patch)
treee827bf252845a0447191b017310c7886d9988a99
parent37ac2b78333d23abfa9274ce773eb620f5813657 (diff)
fix storing of pkg and src deps in app_info
-rw-r--r--src/rebar_digraph.erl5
-rw-r--r--src/rebar_prv_install_deps.erl6
-rw-r--r--test/mock_pkg_resource.erl5
3 files changed, 7 insertions, 9 deletions
diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl
index 9e10d49..7f7909e 100644
--- a/src/rebar_digraph.erl
+++ b/src/rebar_digraph.erl
@@ -125,5 +125,6 @@ find_app_by_name(Name, Apps) ->
end, Apps).
all_apps_deps(App) ->
- Applications = [atom_to_binary(X, utf8) || X <- rebar_app_info:applications(App)],
- lists:usort(rebar_app_info:deps(App) ++ Applications).
+ Applications = lists:usort([atom_to_binary(X, utf8) || X <- rebar_app_info:applications(App)]),
+ Deps = lists:usort(lists:map(fun({Name, _}) -> Name; (Name) -> Name end, rebar_app_info:deps(App))),
+ lists:umerge(Deps, Applications).
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 815d6c8..90bd70c 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -261,9 +261,7 @@ package_to_app(DepsDir, Packages, {Name, Vsn, Level}, IsLock, State) ->
false ->
throw(?PRV_ERROR({missing_package, Name, Vsn}))
end;
- {ok, P} ->
- PkgDeps = [{PkgName, PkgVsn}
- || {PkgName,PkgVsn} <- proplists:get_value(<<"deps">>, P, [])],
+ {ok, PkgDeps} ->
{ok, AppInfo} = rebar_app_info:new(Name, Vsn),
AppInfo1 = rebar_app_info:deps(AppInfo, PkgDeps),
AppInfo2 = rebar_app_info:dir(AppInfo1, filename:join([DepsDir, Name])),
@@ -578,7 +576,7 @@ fetch_app(AppInfo, AppDir, State) ->
end.
update_app_info(AppDir, AppInfo) ->
- {true, Found} = rebar_app_discover:find_app(AppDir, all),
+ {ok, Found} = rebar_app_info:discover(AppDir),
AppDetails = rebar_app_info:app_details(Found),
Applications = proplists:get_value(applications, AppDetails, []),
IncludedApplications = proplists:get_value(included_applications, AppDetails, []),
diff --git a/test/mock_pkg_resource.erl b/test/mock_pkg_resource.erl
index e94ea93..9ed0962 100644
--- a/test/mock_pkg_resource.erl
+++ b/test/mock_pkg_resource.erl
@@ -151,15 +151,14 @@ find_parts([{AppName, Deps}|Rest], Skip, Acc) ->
true -> find_parts(Rest, Skip, Acc);
false ->
AccNew = dict:store(AppName,
- [{<<"deps">>,Deps}, {<<"link">>,<<"undef">>}],
+ Deps,
Acc),
find_parts(Rest, Skip, AccNew)
end.
to_graph_parts(Dict) ->
LastUpdated = os:timestamp(),
- dict:fold(fun(K,V,{Ks,Vs}) ->
- {_,Deps} = lists:keyfind(<<"deps">>, 1, V),
+ dict:fold(fun(K,Deps,{Ks,Vs}) ->
{[{K,LastUpdated}|Ks],
[{K,{list_to_binary(atom_to_list(DK)), list_to_binary(DV)}}
|| {DK,DV} <- Deps] ++ Vs}