aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-02-11 11:56:51 +0100
committerLoïc Hoguin <[email protected]>2020-02-11 11:56:51 +0100
commitff67135accabcb29dda571d6d4cdf2ff53afc500 (patch)
tree4f8ba47eb9ea43cf4915ac6dac5836d78600865a /core/deps.mk
parent7cc51c46fad1ee54a887da2163a4db788ed59af8 (diff)
downloaderlang.mk-ff67135accabcb29dda571d6d4cdf2ff53afc500.tar.gz
erlang.mk-ff67135accabcb29dda571d6d4cdf2ff53afc500.tar.bz2
erlang.mk-ff67135accabcb29dda571d6d4cdf2ff53afc500.zip
Support Hex packages with name different from application2020.02.11
Properly fixes partisan.
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 56c1d1c..6bbb05b 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -323,7 +323,7 @@ define dep_autopatch_rebar.erl
end,
Write("\n")
end(),
- GetHexVsn = fun(N) ->
+ GetHexVsn = fun(N, NP) ->
case file:consult("$(call core_native_path,$(DEPS_DIR)/$1/rebar.lock)") of
{ok, Lock} ->
io:format("~p~n", [Lock]),
@@ -333,7 +333,7 @@ define dep_autopatch_rebar.erl
case lists:keyfind(atom_to_binary(N, latin1), 1, LockPkgs) of
{_, {pkg, _, Vsn}, _} ->
io:format("~p~n", [Vsn]),
- {N, {hex, binary_to_list(Vsn)}};
+ {N, {hex, NP, binary_to_list(Vsn)}};
_ ->
false
end;
@@ -362,10 +362,10 @@ define dep_autopatch_rebar.erl
false -> [];
{_, Deps} ->
[begin case case Dep of
- N when is_atom(N) -> GetHexVsn(N);
- {N, S} when is_atom(N), is_list(S) -> {N, {hex, SemVsn(S)}};
- {_, {pkg, N}} when is_atom(N) -> GetHexVsn(N);
- {_, S, {pkg, N}} -> {N, {hex, S}};
+ N when is_atom(N) -> GetHexVsn(N, N);
+ {N, S} when is_atom(N), is_list(S) -> {N, {hex, N, SemVsn(S)}};
+ {N, {pkg, NP}} when is_atom(N) -> GetHexVsn(N, NP);
+ {N, S, {pkg, NP}} -> {N, {hex, NP, S}};
{N, S} when is_tuple(S) -> {N, S};
{N, _, S} -> {N, S};
{N, _, S, _} -> {N, S};
@@ -374,7 +374,7 @@ define dep_autopatch_rebar.erl
false -> ok;
{Name, Source} ->
{Method, Repo, Commit} = case Source of
- {hex, V} -> {hex, V, undefined};
+ {hex, NPV, V} -> {hex, V, NPV};
{git, R} -> {git, R, master};
{M, R, {branch, C}} -> {M, R, C};
{M, R, {ref, C}} -> {M, R, C};
@@ -655,7 +655,7 @@ endef
define dep_fetch_hex
mkdir -p $(ERLANG_MK_TMP)/hex $(DEPS_DIR)/$1; \
$(call core_http_get,$(ERLANG_MK_TMP)/hex/$1.tar,\
- https://repo.hex.pm/tarballs/$1-$(strip $(word 2,$(dep_$1))).tar); \
+ https://repo.hex.pm/tarballs/$(if $(word 3,$(dep_$1)),$(word 3,$(dep_$1)),$1)-$(strip $(word 2,$(dep_$1))).tar); \
tar -xOf $(ERLANG_MK_TMP)/hex/$1.tar contents.tar.gz | tar -C $(DEPS_DIR)/$1 -xzf -;
endef