From 0a9584832a760d48e0ecf4ebf344787028f91949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 5 May 2023 17:27:35 +0200 Subject: 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. --- core/deps.mk | 35 ++++++++++++++++++++--------------- 1 file 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() -> -- cgit v1.2.3