From de19f96182b5dd58f8fdec2e75cabb6e64adf40d Mon Sep 17 00:00:00 2001 From: Adam Lindberg Date: Thu, 9 Dec 2021 16:12:34 +0100 Subject: [PATCH] Force configure if source was newly downloaded or cleaned --- src/grisp_tools_build.erl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/grisp_tools_build.erl b/src/grisp_tools_build.erl index 69e54ee..04aefd1 100644 --- a/src/grisp_tools_build.erl +++ b/src/grisp_tools_build.erl @@ -143,10 +143,15 @@ configure(#{build := Build} = S0) -> % We must configure if we just downloaded or cleaned the repository case WasDownloaded orelse DidClean orelse ShouldConfigure of true -> - Opts = [{cd, mapz:deep_get([paths, build], S0)}], + S1 = case {WasDownloaded, DidClean, ShouldConfigure} of + {true, _, false} -> event(S0, [{'_override', download}]); + {_, true, false} -> event(S0, [{'_override', clean}]); + {_, _, _} -> S0 + end, + Opts = [{cd, mapz:deep_get([paths, build], S1)}], % TODO: Remove autoconf step when supporting only 23.3+ (not needed) - S1 = build_step("./otp_build autoconf", Opts, S0), - XCompConf = mapz:deep_get([build, config, xcomp_conf], S0), + S2 = build_step("./otp_build autoconf", Opts, S1), + XCompConf = mapz:deep_get([build, config, xcomp_conf], S2), Command = [ "./otp_build configure ", " --prefix=/", @@ -167,7 +172,7 @@ configure(#{build := Build} = S0) -> " --without-wx", " --xcomp-conf=", XCompConf ], - build_step(Command, Opts, S1); + build_step(Command, Opts, S2); false -> event(S0, ['_skip']) end.