diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-02-05 18:08:10 -0600 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-02-05 18:08:10 -0600 |
commit | 4408d8e5029b61923263803457f8990fdb9bb365 (patch) | |
tree | c9fb32e6e520b9f0f7823d4935b0c2d291fcfc1d | |
parent | b11f37e0dbaf2d3423bd5356cc63e6b97663656b (diff) | |
parent | d53fb93cc1365e7b42f71cf6206a844bcdbd0e98 (diff) |
Merge pull request #123 from tsloughter/pkg_deps
package dep names are binary, fix install deps and related tests
-rw-r--r-- | src/rebar_digraph.erl | 18 | ||||
-rw-r--r-- | src/rebar_prv_install_deps.erl | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl index 55d7272..3f942ef 100644 --- a/src/rebar_digraph.erl +++ b/src/rebar_digraph.erl @@ -40,15 +40,15 @@ add(Graph, {PkgName, Deps}) -> end, lists:foreach(fun(DepName) -> - case DepName of - {Name, _Vsn} -> - Name; - Name -> - Name - end, - V3 = case digraph:vertex(Graph, Name) of + Name1 = case DepName of + {Name, _Vsn} -> + ec_cnv:to_binary(Name); + Name -> + ec_cnv:to_binary(Name) + end, + V3 = case digraph:vertex(Graph, Name1) of false -> - digraph:add_vertex(Graph, Name); + digraph:add_vertex(Graph, Name1); {V2, []} -> V2 end, @@ -112,5 +112,5 @@ names_to_apps(Names, Apps) -> -spec find_app_by_name(atom(), [rebar_app_info:t()]) -> {ok, rebar_app_info:t()} | error. find_app_by_name(Name, Apps) -> ec_lists:find(fun(App) -> - binary_to_atom(rebar_app_info:name(App), utf8) =:= binary_to_atom(Name, utf8) + rebar_app_info:name(App) =:= Name end, Apps). diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index fc876bd..025d32a 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -226,7 +226,7 @@ package_to_app(DepsDir, Packages, {Name, Vsn}) -> error -> {error, missing_package}; {ok, P} -> - PkgDeps = [{atom_to_binary(PkgName,utf8), list_to_binary(PkgVsn)} + PkgDeps = [{PkgName, PkgVsn} || {PkgName,PkgVsn} <- proplists:get_value(<<"deps">>, P, [])], Link = proplists:get_value(<<"link">>, P, ""), {ok, AppInfo} = rebar_app_info:new(Name, Vsn), |