summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--priv/templates/otp_app.app.src1
-rw-r--r--priv/templates/otp_lib.app.src1
-rw-r--r--src/rebar_hex_repos.erl5
-rw-r--r--src/rebar_hg_resource.erl3
-rw-r--r--test/rebar_pkg_repos_SUITE.erl8
5 files changed, 10 insertions, 8 deletions
diff --git a/priv/templates/otp_app.app.src b/priv/templates/otp_app.app.src
index 6040089..f6e9d45 100644
--- a/priv/templates/otp_app.app.src
+++ b/priv/templates/otp_app.app.src
@@ -11,7 +11,6 @@
{env,[]},
{modules, []},
- {maintainers, []},
{licenses, ["Apache 2.0"]},
{links, []}
]}.
diff --git a/priv/templates/otp_lib.app.src b/priv/templates/otp_lib.app.src
index aa31966..d14752f 100644
--- a/priv/templates/otp_lib.app.src
+++ b/priv/templates/otp_lib.app.src
@@ -9,7 +9,6 @@
{env,[]},
{modules, []},
- {maintainers, []},
{licenses, ["Apache 2.0"]},
{links, []}
]}.
diff --git a/src/rebar_hex_repos.erl b/src/rebar_hex_repos.erl
index 57b5bc8..def5f49 100644
--- a/src/rebar_hex_repos.erl
+++ b/src/rebar_hex_repos.erl
@@ -68,17 +68,20 @@ repos(HexConfig) ->
merge_repos(RepoList ++ [HexDefaultConfig])
end.
+%% merge repos must add a field repo_name to work with hex_core 0.4.0
-spec merge_repos([repo()]) -> [repo()].
merge_repos(Repos) ->
lists:foldl(fun(R=#{name := Name}, ReposAcc) ->
%% private organizations include the parent repo before a :
case rebar_string:split(Name, <<":">>) of
[Repo, Org] ->
+ %% hex_core uses repo_name for parent
update_repo_list(R#{name => Name,
+ repo_name => Repo,
organization => Org,
parent => Repo}, ReposAcc);
_ ->
- update_repo_list(R, ReposAcc)
+ update_repo_list(R#{repo_name => Name}, ReposAcc)
end
end, [], Repos).
diff --git a/src/rebar_hg_resource.erl b/src/rebar_hg_resource.erl
index 763803c..5ae1ee0 100644
--- a/src/rebar_hg_resource.erl
+++ b/src/rebar_hg_resource.erl
@@ -200,7 +200,7 @@ check_type_support() ->
case get({is_supported, ?MODULE}) of
true ->
ok;
- false ->
+ _ ->
case rebar_utils:sh("hg --version", [{return_on_error, true},
{use_stdout, false}]) of
{error, _} ->
@@ -210,4 +210,3 @@ check_type_support() ->
ok
end
end.
-
diff --git a/test/rebar_pkg_repos_SUITE.erl b/test/rebar_pkg_repos_SUITE.erl
index c808475..55bc020 100644
--- a/test/rebar_pkg_repos_SUITE.erl
+++ b/test/rebar_pkg_repos_SUITE.erl
@@ -182,23 +182,25 @@ repo_merging(_Config) ->
repo_replacing(_Config) ->
Repo1 = #{name => <<"repo-1">>,
+ repo_name => <<"repo-1">>,
api_url => <<"repo-1/api">>},
Repo2 = #{name => <<"repo-2">>,
+ repo_name => <<"repo-2">>,
repo_url => <<"repo-2/repo">>,
repo_verify => false},
?assertMatch([Repo1, Repo2, #{name := <<"hexpm">>}],
rebar_hex_repos:repos([{repos, [Repo1]},
- {repos, [Repo2]}])),
+ {repos, [Repo2]}])),
%% use of replace is ignored if found in later entries than the first
?assertMatch([Repo1, Repo2, #{name := <<"hexpm">>}],
rebar_hex_repos:repos([{repos, [Repo1]},
- {repos, replace, [Repo2]}])),
+ {repos, replace, [Repo2]}])),
?assertMatch([Repo1],
rebar_hex_repos:repos([{repos, replace, [Repo1]},
- {repos, [Repo2]}])).
+ {repos, [Repo2]}])).
auth_merging(_Config) ->
Repo1 = #{name => <<"repo-1">>,