소스 검색

fix storing of pkg and src deps in app_info

pull/471/head
Tristan Sloughter 10 년 전
부모
커밋
f772dcee2e
3개의 변경된 파일7개의 추가작업 그리고 9개의 파일을 삭제
  1. +3
    -2
      src/rebar_digraph.erl
  2. +2
    -4
      src/rebar_prv_install_deps.erl
  3. +2
    -3
      test/mock_pkg_resource.erl

+ 3
- 2
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).

+ 2
- 4
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, []),

+ 2
- 3
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}

불러오는 중...
취소
저장