From 215286760ac497698c937251c9e7623e8c9ba9d0 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sun, 12 Jun 2022 21:05:36 +0200 Subject: [PATCH] build: ignore _build sub-dir in release dir --- scripts/update_appup.escript | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/update_appup.escript b/scripts/update_appup.escript index dd8dd9ca2..0ac5084ab 100755 --- a/scripts/update_appup.escript +++ b/scripts/update_appup.escript @@ -55,7 +55,10 @@ app_specific_actions(_) -> []. ignored_apps() -> - [gpb, emqx_dashboard, emqx_management] ++ otp_standard_apps(). + [gpb, %% only a build tool + emqx_dashboard, %% generic appup file for all versions + emqx_management %% generic appup file for all versions + ] ++ otp_standard_apps(). main(Args) -> #{prev_tag := Baseline} = Options = parse_args(Args, default_options()), @@ -530,8 +533,10 @@ contains_contents(File, Upgrade, Downgrade) -> index_apps(ReleaseDir) -> log("INFO: indexing apps in ~s~n", [ReleaseDir]), - Apps0 = maps:from_list([index_app(filename:join(ReleaseDir, AppFile)) || - AppFile <- filelib:wildcard("**/ebin/*.app", ReleaseDir)]), + AppFiles0 = filelib:wildcard("**/ebin/*.app", ReleaseDir), + %% everything in _build sub-dir e.g. cuttlefish/_build should be ignored + AppFiles = lists:filter(fun(File) -> re:run(File, "_build") =:= nomatch end, AppFiles0), + Apps0 = maps:from_list([index_app(filename:join(ReleaseDir, AppFile)) || AppFile <- AppFiles]), maps:without(ignored_apps(), Apps0). index_app(AppFile) ->