diff options
author | Loïc Hoguin <[email protected]> | 2018-03-05 13:22:24 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-03-05 13:22:24 +0100 |
commit | a22f31ebf0f97025d6534bfce448e85a421af1a0 (patch) | |
tree | b4400480cf9eb5b648dcce964c11ef4a76aeb16b /core | |
parent | 5a961bd91176a0b6a0606df6c110d3e212a264f1 (diff) | |
download | erlang.mk-a22f31ebf0f97025d6534bfce448e85a421af1a0.tar.gz erlang.mk-a22f31ebf0f97025d6534bfce448e85a421af1a0.tar.bz2 erlang.mk-a22f31ebf0f97025d6534bfce448e85a421af1a0.zip |
Fetch the version from rebar.lock if not specified in rebar.config2018.03.05
This fixes hackney.
Diffstat (limited to 'core')
-rw-r--r-- | core/deps.mk | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/deps.mk b/core/deps.mk index 3fdb735..f694708 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -269,11 +269,33 @@ define dep_autopatch_rebar.erl end, Write("\n") end(), + GetHexVsn = fun(N) -> + case file:consult("$(call core_native_path,$(DEPS_DIR)/$1/rebar.lock)") of + {ok, Lock} -> + io:format("~p~n", [Lock]), + case lists:keyfind("1.1.0", 1, Lock) of + {_, LockPkgs} -> + io:format("~p~n", [LockPkgs]), + case lists:keyfind(atom_to_binary(N, latin1), 1, LockPkgs) of + {_, {pkg, _, Vsn}, _} -> + io:format("~p~n", [Vsn]), + {N, {hex, binary_to_list(Vsn)}}; + _ -> + false + end; + _ -> + false + end; + _ -> + false + end + end, fun() -> File = case lists:keyfind(deps, 1, Conf) of 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, S}}; {N, S} when is_tuple(S) -> {N, S}; {N, _, S} -> {N, S}; |