Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
8021-Remove-archives-support-in-reltool.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 8021-Remove-archives-support-in-reltool.patch of Package erlang
From 82ee790a5c1e5d4c68e49d9f1507d9b93c428246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@dashbit.co> Date: Thu, 9 Feb 2023 21:49:32 +0100 Subject: [PATCH] Remove archives support in reltool reltool would package applications in archives by default but there is little to no gain in doing so. Furthermore, this ability pushed complexity into other parts of Erlang/OTP, such as the code server, erl_prim_loader, and the init module. This release makes it so archives are no longer supported but the underlying options still warn to avoid breaking changes. No functionality should be removed from the assembled released (except that they will have 100% fewer archives). --- lib/reltool/doc/src/reltool.xml | 64 +------------- lib/reltool/doc/src/reltool_examples.xml | 73 ++++++---------- lib/reltool/src/reltool.hrl | 21 +---- lib/reltool/src/reltool_server.erl | 32 ++----- lib/reltool/src/reltool_target.erl | 102 ++-------------------- lib/reltool/test/reltool_server_SUITE.erl | 43 +++------ 6 files changed, 55 insertions(+), 280 deletions(-) diff --git a/lib/reltool/doc/src/reltool.xml b/lib/reltool/doc/src/reltool.xml index ab27a03ff8..3d22c63440 100644 --- a/lib/reltool/doc/src/reltool.xml +++ b/lib/reltool/doc/src/reltool.xml @@ -325,40 +325,6 @@ <c>[]</c>.</p> </item> - <tag><c>incl_archive_filters</c></tag> - <item> - <p>This parameter normally contains a list of regular - expressions that controls which top level directories in an - application should be included in an archive file (as - opposed to being included as a regular directory outside the - archive). Each top directory in the application must match at - least one of the listed regular expressions in order to be - included. Further the files may not match any filter in - <c>excl_app_filters</c> in order to be included. This - parameter defaults to <c>[".*"]</c>.</p> - </item> - - <tag><c>excl_archive_filters</c></tag> - <item> - <p>This parameter normally contains a list of regular - expressions that controls which top level directories in an - application should not be included in an archive file. In - order to be included in the application archive, a top - directory must match some filter in <c>incl_archive_filters</c> - but not any filter in <c>excl_archive_filters</c>. This - parameter defaults to <c>["^include$","^priv$"]</c>.</p> - </item> - - <tag><c>archive_opts</c></tag> - <item> - <p>This parameter contains a list of options that are given to - <c>zip:create/3</c> when application specific files are - packaged into an archive. Only a subset of the options are - supported. The most useful options in this context are the ones - that control which types of files should be compressed. This - parameter defaults to <c>[]</c>.</p> - </item> - </taglist> <p>On application (<c>escript</c>) level, the following options are @@ -441,24 +407,6 @@ <p>The value of this parameter overrides the parameter with the same name on system level.</p> </item> - - <tag><c>incl_archive_filters</c></tag> - <item> - <p>The value of this parameter overrides the parameter with the - same name on system level.</p> - </item> - - <tag><c>excl_archive_filters</c></tag> - <item> - <p>The value of this parameter overrides the parameter with the - same name on system level.</p> - </item> - - <tag><c>archive_opts</c></tag> - <item> - <p>The value of this parameter overrides the parameter with the - same name on system level.</p> - </item> </taglist> <p>On module (<c>mod</c>) level, the following options are @@ -511,9 +459,6 @@ sys() = {root_dir, root_dir()} | {excl_sys_filters, excl_sys_filters()} | {incl_app_filters, incl_app_filters()} | {excl_app_filters, excl_app_filters()} - | {incl_archive_filters, incl_archive_filters()} - | {excl_archive_filters, excl_archive_filters()} - | {archive_opts, [archive_opt()]} app() = {vsn, app_vsn()} | {lib_dir, lib_dir()} | {mod, mod_name(), [mod()]} @@ -526,9 +471,6 @@ app() = {vsn, app_vsn()} | {excl_sys_filters, excl_sys_filters()} | {incl_app_filters, incl_app_filters()} | {excl_app_filters, excl_app_filters()} - | {incl_archive_filters, incl_archive_filters()} - | {excl_archive_filters, excl_archive_filters()} - | {archive_opts, [archive_opt()]} mod() = {incl_cond, incl_cond()} | {debug_info, debug_info()} rel_app() = app_name() @@ -539,7 +481,6 @@ rel_opt() = {load_dot_erlang, boolean()} app_name() = atom() app_type() = permanent | transient | temporary | load | none app_vsn() = string() -archive_opt = zip_create_opt() boot_rel() = rel_name() app_file() = keep | strip | all debug_info() = keep | strip | [beam_lib:chunkid()] @@ -547,13 +488,11 @@ dir() = string() escript() = {incl_cond, incl_cond()} escript_file() = file() excl_app_filters() = regexps() -excl_archive_filters() = regexps() excl_lib() = otp_root excl_sys_filters() = regexps() file() = string() incl_app() = app_name() incl_app_filters() = regexps() -incl_archive_filters() = regexps() incl_cond() = include | exclude | derived incl_sys_filters() = regexps() lib_dir() = dir() @@ -582,7 +521,6 @@ top_file() = file() target_spec() = [target_spec()] | {create_dir, base_dir(), [target_spec()]} | {create_dir, base_dir(), top_dir(), [target_spec()]} - | {archive, base_file(), [archive_opt()], [target_spec()]} | {copy_file, base_file()} | {copy_file, base_file(), top_file()} | {write_file, base_file(), iolist()} @@ -632,7 +570,7 @@ target_spec() = [target_spec()] <c>releases</c> directory contains generated <c>rel</c>, <c>script</c>, and <c>boot</c> files. The <c>lib</c> directory contains the applications. Which applications are included - and if they should be customized (archived, stripped from debug + and if they should be customized (stripped from debug info etc.) is specified with various configuration parameters. The files in the <c>bin</c> directory are copied from the <c>erts-vsn/bin</c> directory, but only those files diff --git a/lib/reltool/doc/src/reltool_examples.xml b/lib/reltool/doc/src/reltool_examples.xml index 76db47a760..aab24556df 100644 --- a/lib/reltool/doc/src/reltool_examples.xml +++ b/lib/reltool/doc/src/reltool_examples.xml @@ -136,9 +136,6 @@ Eshell V9.0 (abort with ^G) {excl_sys_filters,[]}, {incl_app_filters,[".*"]}, {excl_app_filters,[]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,[[...]|...]}, - {archive_opts,[]}, {rel_app_type,...}, {...}|...]}} 6> @@ -270,9 +267,6 @@ Eshell V9.0 (abort with ^G) "^erts.*/bin/.*(debug|pdb)"]}, {incl_app_filters,["^ebin","^include","^priv"]}, {excl_app_filters,[]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,["^include$","^priv$"]}, - {archive_opts,[]}, {rel_app_type,permanent}, {embedded_app_type,load}, {app_file,keep}, @@ -296,9 +290,6 @@ Eshell V9.0 (abort with ^G) "^erts.*/bin/.*(debug|pdb)"]}, {incl_app_filters,["^ebin","^priv"]}, {excl_app_filters,["^ebin/.*\\.appup$"]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,["^include$","^priv$"]}, - {archive_opts,[]}, {rel_app_type,permanent}, {app_file,keep}, {debug_info,keep}]}} @@ -492,47 +483,41 @@ Eshell V10.0 (abort with ^G) {copy_file,...}, {...}]}]}, {create_dir,"lib", - [{archive,"compiler-7.0.4.ez",[], - [{create_dir,"compiler-7.0.4", - [{create_dir,"src", - [{copy_file,"beam_flatten.erl"}, - {copy_file,[...]}, - {copy_file,...}, - {...}|...]}, - {create_dir,"ebin", - [{copy_file,[...]},{copy_file,...},{...}|...]}]}]}, - {archive,"crypto-3.7.4.ez",[], - [{create_dir,"crypto-3.7.4", - [{create_dir,"src",[{copy_file,[...]},{copy_file,...}]}, - {create_dir,"ebin",[{copy_file,...},{...}|...]}]}]}, + [{create_dir,"compiler-7.0.4", + [{create_dir,"src", + [{copy_file,"beam_flatten.erl"}, + {copy_file,[...]}, + {copy_file,...}, + {...}|...]}, + {create_dir,"ebin", + [{copy_file,[...]},{copy_file,...},{...}|...]}]}, + {create_dir,"crypto-3.7.4", + [{create_dir,"src",[{copy_file,[...]},{copy_file,...}]}, + {create_dir,"ebin",[{copy_file,...},{...}|...]}]}, {create_dir,"crypto-3.7.4", [{create_dir,"priv", [{create_dir,"lib",[{copy_file,[...]},{copy_file,...}]}, {create_dir,"obj",[{copy_file,...},{...}|...]}]}]}, - {archive,"erts-10.0.ez",[], - [{create_dir,"erts-10.0", - [{create_dir,"src",[{...}|...]}, - {create_dir,"ebin",[...]}]}]}, - {archive,"hipe-3.15.4.ez",[], - [{create_dir,"hipe-3.15.4", - [{create_dir,"flow",[...]}, - {copy_file,[...]}, - {create_dir,...}, - {...}|...]}]}, - {archive,"inets-6.3.9.ez",[], - [{create_dir,"inets-6.3.9", - [{create_dir,[...],...},{create_dir,...},{...}]}]}, + {create_dir,"erts-10.0", + [{create_dir,"src",[{...}|...]}, + {create_dir,"ebin",[...]}]}, + {create_dir,"hipe-3.15.4", + [{create_dir,"flow",[...]}, + {copy_file,[...]}, + {create_dir,...}, + {...}|...]}, + {create_dir,"inets-6.3.9", + [{create_dir,[...],...},{create_dir,...},{...}]}, {create_dir,"inets-6.3.9", [{create_dir,"priv",[{create_dir,[...],...}]}, {create_dir,"include",[{copy_file,...},{...}]}]}, - {archive,"kernel-5.2.ez",[], - [{create_dir,"kernel-5.2",[{...}|...]}]}, + {create_dir,"kernel-5.2",[{...}|...]}, {create_dir,"kernel-5.2", [{create_dir,"include",[{...}|...]}]}, - {archive,"sasl-3.0.3.ez",[],[{create_dir,[...],...}]}, - {archive,"stdlib-3.3.ez",[],[{create_dir,...}]}, + {create_dir,[...],...}, + {create_dir,...}, {create_dir,"stdlib-3.3",[{create_dir,...}]}, - {archive,"tools-2.9.1.ez",[],[...]}]}]} + ...]}]} 3> 3> TargetDir = "/tmp/my_target_dir". "/tmp/my_target_dir" @@ -551,10 +536,10 @@ ok "releases"]} 8> 8> file:list_dir(filename:join([TargetDir,"lib"])). -{ok,["tools-2.9.1.ez","kernel-5.2.ez","inets-6.3.9.ez", - "kernel-5.2","sasl-3.0.3.ez","hipe-3.15.4.ez","inets-6.3.9", - "crypto-3.7.4","crypto-3.7.4.ez","stdlib-3.3.ez", - "erts-10.0.ez","stdlib-3.3","compiler-7.0.4.ez"]} +{ok,["tools-2.9.1","inets-6.3.9", + "kernel-5.2","sasl-3.0.3", + "crypto-3.7.4","erts-10.0", + "stdlib-3.3","compiler-7.0.4"]} 9> 9> file:make_dir("/tmp/yet_another_target_dir"). ok diff --git a/lib/reltool/src/reltool.hrl b/lib/reltool/src/reltool.hrl index 6cbadc3ade..348bee82a4 100644 --- a/lib/reltool/src/reltool.hrl +++ b/lib/reltool/src/reltool.hrl @@ -38,9 +38,6 @@ -type excl_sys_filters() :: regexps(). -type incl_app_filters() :: regexps(). -type excl_app_filters() :: regexps(). --type incl_archive_filters() :: regexps(). --type excl_archive_filters() :: regexps(). --type archive_opt() :: term(). % zip:create() -type root_dir() :: dir(). -type lib_dir() :: dir(). -type profile() :: development | embedded | standalone. @@ -72,9 +69,7 @@ | {app_file, app_file()} | {debug_info, debug_info()} | {incl_app_filters, incl_app_filters()} - | {excl_app_filters, excl_app_filters()} - | {incl_archive_filters, incl_archive_filters()} - | {excl_archive_filters, excl_archive_filters()}. + | {excl_app_filters, excl_app_filters()}. -type escript() :: {incl_cond, incl_cond()}. -type sys() :: {mod_cond, mod_cond()} | {incl_cond, incl_cond()} @@ -86,9 +81,6 @@ | {excl_sys_filters, excl_sys_filters()} | {incl_app_filters, incl_app_filters()} | {excl_app_filters, excl_app_filters()} - | {incl_archive_filters, incl_archive_filters()} - | {excl_archive_filters, excl_archive_filters()} - | {archive_opts, [archive_opt()]} | {root_dir, root_dir()} | {lib_dirs, [lib_dir()]} | {boot_rel, boot_rel()} @@ -119,7 +111,6 @@ -type target_spec() :: [target_spec()] | {create_dir, base_dir(), [target_spec()]} | {create_dir, base_dir(), top_dir(), [target_spec()]} - | {archive, base_file(), [archive_opt()], [target_spec()]} | {copy_file, base_file()} | {copy_file, base_file(), top_file()} | {write_file, base_file(), binary()} @@ -198,9 +189,6 @@ app_type :: '_' | app_type() | undefined, incl_app_filters :: '_' | [#regexp{}] | undefined, excl_app_filters :: '_' | [#regexp{}] | undefined, - incl_archive_filters :: '_' | [#regexp{}] | undefined, - excl_archive_filters :: '_' | [#regexp{}] | undefined, - archive_opts :: '_' | [archive_opt()] | undefined, %% Dynamic status :: '_' | status(), @@ -247,9 +235,6 @@ excl_sys_filters :: [#regexp{}], incl_app_filters :: [#regexp{}], excl_app_filters :: [#regexp{}], - incl_archive_filters :: [#regexp{}], - excl_archive_filters :: [#regexp{}], - archive_opts :: [archive_opt()], relocatable :: boolean(), rel_app_type :: app_type(), embedded_app_type :: app_type() | undefined, @@ -280,10 +265,6 @@ -define(DEFAULT_APP_FILE, keep). -define(DEFAULT_DEBUG_INFO, keep). --define(DEFAULT_INCL_ARCHIVE_FILTERS, [".*"]). --define(DEFAULT_EXCL_ARCHIVE_FILTERS, ["^include\$", "^priv\$"]). --define(DEFAULT_ARCHIVE_OPTS, []). - -define(DEFAULT_INCL_SYS_FILTERS, [".*"]). -define(DEFAULT_EXCL_SYS_FILTERS, []). -define(DEFAULT_INCL_APP_FILTERS, [".*"]). diff --git a/lib/reltool/src/reltool_server.erl b/lib/reltool/src/reltool_server.erl index 6b7a79c62f..953f56a573 100644 --- a/lib/reltool/src/reltool_server.erl +++ b/lib/reltool/src/reltool_server.erl @@ -196,13 +196,6 @@ default_sys() -> rel_app_type = ?DEFAULT_REL_APP_TYPE, embedded_app_type = ?DEFAULT_EMBEDDED_APP_TYPE, app_file = ?DEFAULT_APP_FILE, - incl_archive_filters = dec_re(incl_archive_filters, - ?DEFAULT_INCL_ARCHIVE_FILTERS, - []), - excl_archive_filters = dec_re(excl_archive_filters, - ?DEFAULT_EXCL_ARCHIVE_FILTERS, - []), - archive_opts = ?DEFAULT_ARCHIVE_OPTS, debug_info = ?DEFAULT_DEBUG_INFO}. dec_re(Key, Regexps, Old) -> @@ -450,9 +443,6 @@ app_set_config_only([],#app{name = Name, app_type = undefined, incl_app_filters = undefined, excl_app_filters = undefined, - incl_archive_filters = undefined, - excl_archive_filters = undefined, - archive_opts = undefined, is_escript = false})-> {delete,Name}; app_set_config_only(Mods,#app{name = Name, @@ -464,9 +454,6 @@ app_set_config_only(Mods,#app{name = Name, app_type = AppType, incl_app_filters = InclAppFilters, excl_app_filters = ExclAppFilters, - incl_archive_filters = InclArchiveFilters, - excl_archive_filters = ExclArchiveFilters, - archive_opts = ArchiveOpts, vsn = Vsn, is_escript = IsEscript, label = Label, @@ -481,9 +468,6 @@ app_set_config_only(Mods,#app{name = Name, app_type = AppType, incl_app_filters = InclAppFilters, excl_app_filters = ExclAppFilters, - incl_archive_filters = InclArchiveFilters, - excl_archive_filters = ExclArchiveFilters, - archive_opts = ArchiveOpts, vsn = Vsn, mods = Mods}, @@ -1563,13 +1547,11 @@ decode(#sys{} = Sys, [{Key, Val} | KeyVals]) -> Sys#sys{excl_app_filters = dec_re(Key, Val, Sys#sys.excl_app_filters)}; incl_archive_filters -> - Sys#sys{incl_archive_filters = - dec_re(Key, Val, Sys#sys.incl_archive_filters)}; + io:format("incl_archive_filters is no longer supported in reltool"); excl_archive_filters -> - Sys#sys{excl_archive_filters = - dec_re(Key, Val, Sys#sys.excl_archive_filters)}; + io:format("excl_archive_filters is no longer supported in reltool"); archive_opts when is_list(Val) -> - Sys#sys{archive_opts = Val}; + io:format("archive_opts is no longer supported in reltool"); relocatable when Val =:= true; Val =:= false -> Sys#sys{relocatable = Val}; rel_app_type when Val =:= permanent; @@ -1629,13 +1611,11 @@ decode(#app{} = App, [{Key, Val} | KeyVals]) -> App#app{excl_app_filters = dec_re(Key, Val, App#app.excl_app_filters)}; incl_archive_filters -> - App#app{incl_archive_filters = - dec_re(Key, Val, App#app.incl_archive_filters)}; + io:format("incl_archive_filters is no longer supported in reltool"); excl_archive_filters -> - App#app{excl_archive_filters = - dec_re(Key, Val, App#app.excl_archive_filters)}; + io:format("excl_archive_filters is no longer supported in reltool"); archive_opts when is_list(Val) -> - App#app{archive_opts = Val}; + io:format("archive_opts is no longer supported in reltool"); vsn when is_list(Val), App#app.use_selected_vsn=:=undefined -> App#app{use_selected_vsn = vsn, vsn = Val}; lib_dir when is_list(Val), App#app.use_selected_vsn=:=undefined -> diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl index 304167c44b..6224e19430 100644 --- a/lib/reltool/src/reltool_target.erl +++ b/lib/reltool/src/reltool_target.erl @@ -81,9 +81,6 @@ do_gen_config(#sys{root_dir = RootDir, excl_sys_filters = ExclSysFiles, incl_app_filters = InclAppFiles, excl_app_filters = ExclAppFiles, - incl_archive_filters = InclArchiveDirs, - excl_archive_filters = ExclArchiveDirs, - archive_opts = ArchiveOpts, relocatable = Relocatable, rel_app_type = RelAppType, embedded_app_type = InclAppType, @@ -133,9 +130,6 @@ do_gen_config(#sys{root_dir = RootDir, emit(excl_sys_filters, X(ExclSysFiles), reltool_utils:choose_default(excl_sys_filters, Profile, InclDefs), InclDefs) ++ emit(incl_app_filters, X(InclAppFiles), reltool_utils:choose_default(incl_app_filters, Profile, InclDefs), InclDefs) ++ emit(excl_app_filters, X(ExclAppFiles), reltool_utils:choose_default(excl_app_filters, Profile, InclDefs), InclDefs) ++ - emit(incl_archive_filters, X(InclArchiveDirs), ?DEFAULT_INCL_ARCHIVE_FILTERS, InclDefs) ++ - emit(excl_archive_filters, X(ExclArchiveDirs), ?DEFAULT_EXCL_ARCHIVE_FILTERS, InclDefs) ++ - emit(archive_opts, ArchiveOpts, ?DEFAULT_ARCHIVE_OPTS, InclDefs) ++ emit(rel_app_type, RelAppType, ?DEFAULT_REL_APP_TYPE, InclDefs) ++ emit(embedded_app_type, InclAppType, reltool_utils:choose_default(embedded_app_type, Profile, InclDefs), InclDefs) ++ emit(app_file, AppFile, ?DEFAULT_APP_FILE, InclDefs) ++ @@ -147,9 +141,6 @@ do_gen_config(#app{name = Name, app_file = AppFile, incl_app_filters = InclAppFiles, excl_app_filters = ExclAppFiles, - incl_archive_filters = InclArchiveDirs, - excl_archive_filters = ExclArchiveDirs, - archive_opts = ArchiveOpts, use_selected_vsn = UseSelected, vsn = Vsn, active_dir = ActiveDir, @@ -164,9 +155,6 @@ do_gen_config(#app{name = Name, emit(app_file, AppFile, undefined, InclDefs), emit(incl_app_filters, InclAppFiles, undefined, InclDefs), emit(excl_app_filters, ExclAppFiles, undefined, InclDefs), - emit(incl_archive_filters, InclArchiveDirs, undefined, InclDefs), - emit(excl_archive_filters, ExclArchiveDirs, undefined, InclDefs), - emit(archive_opts, ArchiveOpts, undefined, InclDefs), if IsIncl, InclDefs -> [{vsn, Vsn}, {lib_dir, ActiveDir}]; UseSelected =:= vsn -> [{vsn, Vsn}]; @@ -1075,12 +1063,14 @@ check_apps([Mandatory | Names], Apps) -> check_apps([], _) -> ok. -spec_app(#app{name = Name, +spec_app(#app{label = Label, + name = Name, mods = Mods, active_dir = SourceDir, incl_app_filters = AppInclRegexps, excl_app_filters = AppExclRegexps} = App, - #sys{incl_app_filters = SysInclRegexps, + #sys{root_dir = RootDir, + incl_app_filters = SysInclRegexps, excl_app_filters = SysExclRegexps, debug_info = SysDebugInfo} = Sys) -> %% List files recursively @@ -1104,47 +1094,7 @@ spec_app(#app{name = Name, ExclRegexps = reltool_utils:default_val(AppExclRegexps, SysExclRegexps), AppFiles3 = filter_spec(AppFiles2, InclRegexps, ExclRegexps), - %% Regular top directory and/or archive - spec_archive(App, Sys, AppFiles3). - -spec_archive(#app{label = Label, - active_dir = SourceDir, - incl_archive_filters = AppInclArchiveDirs, - excl_archive_filters = AppExclArchiveDirs, - archive_opts = AppArchiveOpts}, - #sys{root_dir = RootDir, - incl_archive_filters = SysInclArchiveDirs, - excl_archive_filters = SysExclArchiveDirs, - archive_opts = SysArchiveOpts}, - Files) -> - InclArchiveDirs = - reltool_utils:default_val(AppInclArchiveDirs, SysInclArchiveDirs), - ExclArchiveDirs = - reltool_utils:default_val(AppExclArchiveDirs, SysExclArchiveDirs), - ArchiveOpts = - reltool_utils:default_val(AppArchiveOpts, SysArchiveOpts), - Match = fun(F) -> match(element(2, F), InclArchiveDirs, ExclArchiveDirs) end, - case lists:filter(Match, Files) of - [] -> - %% Nothing to archive - [spec_create_dir(RootDir, SourceDir, Label, Files)]; - ArchiveFiles -> - OptDir = - case Files -- ArchiveFiles of - [] -> - []; - ExternalFiles -> - [spec_create_dir(RootDir, - SourceDir, - Label, - ExternalFiles)] - end, - ArchiveOpts = - reltool_utils:default_val(AppArchiveOpts, SysArchiveOpts), - ArchiveDir = - spec_create_dir(RootDir, SourceDir, Label, ArchiveFiles), - [{archive, Label ++ ".ez", ArchiveOpts, [ArchiveDir]} | OptDir] - end. + [spec_create_dir(RootDir, SourceDir, Label, AppFiles3)]. spec_dir(Dir) -> Base = filename:basename(Dir), @@ -1279,27 +1229,6 @@ do_eval_spec({create_dir, Dir, OldDir, Files}, TargetDir2 = filename:join([TargetDir, Dir]), reltool_utils:create_dir(TargetDir2), do_eval_spec(Files, SourceDir2, SourceDir2, TargetDir2); -do_eval_spec({archive, Archive, Options, Files}, - OrigSourceDir, - SourceDir, - TargetDir) -> - TmpSpec = {create_dir, "tmp", Files}, - TmpDir = filename:join([TargetDir, "tmp"]), - reltool_utils:create_dir(TmpDir), - do_eval_spec(Files, OrigSourceDir, SourceDir, TmpDir), - - ArchiveFile = filename:join([TargetDir, Archive]), - Files2 = [element(2, F) || F <- Files], - Res = zip:create(ArchiveFile, Files2, [{cwd, TmpDir} | Options]), - - cleanup_spec(TmpSpec, TargetDir), - case Res of - {ok, _} -> - ok; - {error, Reason} -> - reltool_utils:throw_error("create archive ~ts failed: ~tp", - [ArchiveFile, Reason]) - end; do_eval_spec({copy_file, File}, _OrigSourceDir, SourceDir, TargetDir) -> SourceFile = filename:join([SourceDir, File]), TargetFile = filename:join([TargetDir, File]), @@ -1339,12 +1268,6 @@ cleanup_spec({create_dir, Dir, _OldDir, Files}, TargetDir) -> TargetDir2 = filename:join([TargetDir, Dir]), cleanup_spec(Files, TargetDir2), file:del_dir(TargetDir2); -cleanup_spec({archive, Archive, _Options, Files}, TargetDir) -> - TargetFile = filename:join([TargetDir, Archive]), - file:delete(TargetFile), - TmpDir = filename:join([TargetDir, "tmp"]), - cleanup_spec(Files, TmpDir), - file:del_dir(TmpDir); cleanup_spec({copy_file, File}, TargetDir) -> TargetFile = filename:join([TargetDir, File]), file:delete(TargetFile); @@ -1397,21 +1320,6 @@ do_filter_spec(Path, Files2 when is_list(Files2) -> {true, {create_dir, NewDir, OldDir, Files2}} end; -do_filter_spec(Path, - {archive, Archive, Options, Files}, - InclRegexps, - ExclRegexps) -> - case do_filter_spec(Path, Files, InclRegexps, ExclRegexps) of - [] -> - case match(Path, InclRegexps, ExclRegexps) of - true -> - {true, {archive, Archive, Options, []}}; - false -> - false - end; - Files2 when is_list(Files2) -> - {true, {archive, Archive, Options, Files2}} - end; do_filter_spec(Path, {copy_file, File}, InclRegexps, ExclRegexps) -> Path2 = opt_join(Path, File), match(Path2, InclRegexps, ExclRegexps); diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 11ae6d6da2..5cf39a393f 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -281,9 +281,6 @@ get_config(_Config) -> {excl_sys_filters,[]}, {incl_app_filters,[".*"]}, {excl_app_filters,[]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,["^include$","^priv$"]}, - {archive_opts,[]}, {rel_app_type,permanent}, {app_file,keep}, {debug_info,keep}]}}, @@ -312,9 +309,6 @@ get_config(_Config) -> {excl_sys_filters,[]}, {incl_app_filters,[".*"]}, {excl_app_filters,[]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,["^include$","^priv$"]}, - {archive_opts,[]}, {rel_app_type,permanent}, {app_file,keep}, {debug_info,keep}]}}, @@ -1252,7 +1246,7 @@ create_slim(Config) -> TargetRelDir = filename:join(TargetDir,"releases"), TargetRelVsnDir = filename:join(TargetRelDir,RelVsn), - {ok,["a-1.0.ez"]} = file:list_dir(TargetLibDir), + {ok,["a-1.0"]} = file:list_dir(TargetLibDir), RootDir = code:root_dir(), Erl = filename:join([RootDir, "bin", "erl"]), @@ -1335,16 +1329,14 @@ otp_9229_dupl_mod_exclude_app(Config) -> {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)), AbsTargetDir = filename:absname(TargetDir), - XArchive = "x-1.0.ez", - AbsXArchive = filename:join([AbsTargetDir,lib,XArchive]), - XEbin = ["ebin","x-1.0",XArchive], - YArchive = "y-1.0.ez", - AbsYArchive = filename:join([AbsTargetDir,lib,YArchive]), + AbsX = filename:join([AbsTargetDir,lib,"x-1.0"]), + XEbin = ["ebin","x-1.0"], + AbsY = filename:join([AbsTargetDir,lib,"y-1.0"]), - ?m(true, filelib:is_file(AbsXArchive)), + ?m(true, filelib:is_file(AbsX)), ?m(XEbin, mod_path(Node,x)), ?m(XEbin, mod_path(Node,mylib)), - ?m(false, filelib:is_file(AbsYArchive)), + ?m(false, filelib:is_file(AbsY)), ?m(non_existing, mod_path(Node,y)), ?msym(ok, stop_node(Node)), @@ -1382,17 +1374,15 @@ otp_9229_dupl_mod_exclude_mod(Config) -> {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)), AbsTargetDir = filename:absname(TargetDir), - XArchive = "x-1.0.ez", - AbsXArchive = filename:join([AbsTargetDir,lib,XArchive]), - XEbin = ["ebin","x-1.0",XArchive], - YArchive = "y-1.0.ez", - AbsYArchive = filename:join([AbsTargetDir,lib,YArchive]), - YEbin = ["ebin","y-1.0",YArchive], - - ?m(true, filelib:is_file(AbsXArchive)), + AbsX = filename:join([AbsTargetDir,lib,"x-1.0"]), + XEbin = ["ebin","x-1.0"], + AbsY = filename:join([AbsTargetDir,lib,"y-1.0"]), + YEbin = ["ebin","y-1.0"], + + ?m(true, filelib:is_file(AbsX)), ?m(XEbin, mod_path(Node,x)), ?m(XEbin, mod_path(Node,mylib)), - ?m(true, filelib:is_file(AbsYArchive)), + ?m(true, filelib:is_file(AbsY)), ?m(YEbin, mod_path(Node,y)), %% Remove path to XEbin and check that mylib is not located in YEbin @@ -2197,9 +2187,6 @@ save_config(Config) -> {excl_sys_filters,[]}, {incl_app_filters,[".*"]}, {excl_app_filters,[]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,["^include$","^priv$"]}, - {archive_opts,[]}, {rel_app_type,permanent}, {app_file,keep}, {debug_info,keep}]}]}, @@ -2238,9 +2225,6 @@ save_config(Config) -> {excl_sys_filters,[]}, {incl_app_filters,[".*"]}, {excl_app_filters,[]}, - {incl_archive_filters,[".*"]}, - {excl_archive_filters,["^include$","^priv$"]}, - {archive_opts,[]}, {rel_app_type,permanent}, {app_file,keep}, {debug_info,keep}]}]}, @@ -2439,7 +2423,6 @@ dep_in_app_not_xref(Config) -> [ {lib_dirs,[filename:join(datadir(Config),"dep_in_app_not_xref")]}, {incl_cond,exclude}, - {incl_archive_filters,[]}, {erts,[{incl_cond,exclude}]}, {boot_rel, RelName}, {rel, RelName, RelVsn, [kernel, stdlib]}, -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor