aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2023-05-05 17:27:35 +0200
committerLoïc Hoguin <[email protected]>2023-05-05 17:27:35 +0200
commit0a9584832a760d48e0ecf4ebf344787028f91949 (patch)
tree1d4c7838771cc499026a919cc003b6521d881f9a
parent9dc118d40ad08e0abdb955793b3e186f685c7e59 (diff)
downloaderlang.mk-0a9584832a760d48e0ecf4ebf344787028f91949.tar.gz
erlang.mk-0a9584832a760d48e0ecf4ebf344787028f91949.tar.bz2
erlang.mk-0a9584832a760d48e0ecf4ebf344787028f91949.zip
Autopatch: add support for >= hex versions
We use the same strategy as ~= we try to look for the version in the .lock file and if we can't find it we guess for now.
-rw-r--r--core/deps.mk35
1 files changed, 20 insertions, 15 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 6741580..5b01b8d 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -413,23 +413,28 @@ define dep_autopatch_rebar.erl
false
end
end,
+ GetHexVsn3Common = fun(N, NP, S0) ->
+ case GetHexVsn2(N, NP) of
+ false ->
+ S2 = case S0 of
+ " " ++ S1 -> S1;
+ _ -> S0
+ end,
+ S = case length([ok || $$. <- S2]) of
+ 0 -> S2 ++ ".0.0";
+ 1 -> S2 ++ ".0";
+ _ -> S2
+ end,
+ {N, {hex, NP, S}};
+ NameSource ->
+ NameSource
+ end
+ end,
GetHexVsn3 = fun
(N, NP, "~>" ++ S0) ->
- case GetHexVsn2(N, NP) of
- false ->
- S2 = case S0 of
- " " ++ S1 -> S1;
- _ -> S0
- end,
- S = case length([ok || $$. <- S2]) of
- 0 -> S2 ++ ".0.0";
- 1 -> S2 ++ ".0";
- _ -> S2
- end,
- {N, {hex, NP, S}};
- NameSource ->
- NameSource
- end;
+ GetHexVsn3Common(N, NP, S0);
+ (N, NP, ">=" ++ S0) ->
+ GetHexVsn3Common(N, NP, S0);
(N, NP, S) -> {N, {hex, NP, S}}
end,
fun() ->