diff options
author | Luis Rascão <[email protected]> | 2018-06-24 00:25:10 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-06-24 00:25:10 +0100 |
commit | efd717e4f4c377d8f435e27c6490a69b35fa8b64 (patch) | |
tree | d9e84b3647bc6bda5870e2b4e599b5f14042c74f | |
parent | d1ee878732ead9fc381999e2340cfb8d25e77066 (diff) | |
parent | 81b25bbe41643be9ef2bbb7583e06dbd702f61c8 (diff) | |
download | relx-efd717e4f4c377d8f435e27c6490a69b35fa8b64.tar.gz relx-efd717e4f4c377d8f435e27c6490a69b35fa8b64.tar.bz2 relx-efd717e4f4c377d8f435e27c6490a69b35fa8b64.zip |
Merge pull request #661 from tsloughter/copy-file-infov3.26.0
only copy mode and time attributes when copying files
-rw-r--r-- | rebar.config | 3 | ||||
-rw-r--r-- | rebar.lock | 4 | ||||
-rw-r--r-- | src/rlx_prv_assembler.erl | 14 | ||||
-rw-r--r-- | src/rlx_prv_overlay.erl | 7 |
4 files changed, 14 insertions, 14 deletions
diff --git a/rebar.config b/rebar.config index 82d9f98..6e11828 100644 --- a/rebar.config +++ b/rebar.config @@ -1,6 +1,6 @@ %% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- %% Dependencies ================================================================ -{deps, [{erlware_commons, "1.0.5"}, +{deps, [{erlware_commons, "1.2.0"}, {providers, "1.7.0"}, {getopt, "1.0.1"}, {cf, "0.2.2"}, @@ -55,6 +55,7 @@ {platform_define, "^R1[4|5]", deprecated_crypto}, {platform_define, "^((1[8|9])|2)", rand_module}, {platform_define, "^2", unicode_str}, + {platform_define, "^(R|1|20)", fun_stacktrace}, no_debug_info, warnings_as_errors ]}, @@ -1,14 +1,14 @@ {"1.1.0", [{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.0.4">>},0}, {<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},0}, - {<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.0.5">>},0}, + {<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.2.0">>},0}, {<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0}, {<<"providers">>,{pkg,<<"providers">>,<<"1.7.0">>},0}]}. [ {pkg_hash,[ {<<"bbmustache">>, <<"7BA94F971C5AFD7B6617918A4BB74705E36CAB36EB84B19B6A1B7EE06427AA38">>}, {<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>}, - {<<"erlware_commons">>, <<"FC23D8E304140B65A811F653A76B2FB10B0CE744608CAF86E9125CEB349C9442">>}, + {<<"erlware_commons">>, <<"2BAB99CF88941145767A502F1209886F1F0D31695EEF21978A30F15E645721E0">>}, {<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>}, {<<"providers">>, <<"BBF730563914328EC2511D205E6477A94831DB7297DE313B3872A2B26C562EAB">>}]} ]. diff --git a/src/rlx_prv_assembler.erl b/src/rlx_prv_assembler.erl index 705e51a..cb5bbed 100644 --- a/src/rlx_prv_assembler.erl +++ b/src/rlx_prv_assembler.erl @@ -344,7 +344,7 @@ copy_dir(State, App, AppDir, TargetDir, SubDir) -> %% no files are excluded, just copy the whole dir copy_dir(SourceDir, TargetDir, []) -> - case ec_file:copy(SourceDir, TargetDir, [recursive]) of + case ec_file:copy(SourceDir, TargetDir, [recursive, {file_info, [mode, time]}]) of {error, E} -> {error, E}; ok -> ok @@ -355,7 +355,7 @@ copy_dir(SourceDir, TargetDir, ExcludeFiles) -> lists:foreach(fun(F) -> ok = ec_file:copy(F, filename:join([TargetDir, - filename:basename(F)])) + filename:basename(F)]), [{file_info, [mode, time]}]) end, SourceFiles -- ExcludeFiles). create_release_info(State0, Release0, OutputDir) -> @@ -655,7 +655,7 @@ copy_or_symlink_config_file(State, ConfigPath, RelConfPath) -> true -> ok = rlx_util:symlink_or_copy(ConfigPath, RelConfPath); _ -> - ok = ec_file:copy(ConfigPath, RelConfPath) + ok = ec_file:copy(ConfigPath, RelConfPath, [{file_info, [mode, time]}]) end. %% @doc Optionally add erts directory to release, if defined. @@ -686,7 +686,7 @@ include_erts(State, Release, OutputDir, RelDir) -> ?RLX_ERROR({specified_erts_does_not_exist, ErtsVersion}); true -> ok = ec_file:mkdir_p(LocalErts), - ok = ec_file:copy(ErtsDir, LocalErts, [recursive]), + ok = ec_file:copy(ErtsDir, LocalErts, [recursive, {file_info, [mode, time]}]), case OsFamily of unix -> Erl = filename:join([LocalErts, "bin", "erl"]), @@ -797,7 +797,8 @@ create_boot_file(RelDir, OutputDir, Options, State, Name) -> end) of ok -> ok = ec_file:copy(filename:join([RelDir, Name++".boot"]), - filename:join([OutputDir, "bin", Name++".boot"])), + filename:join([OutputDir, "bin", Name++".boot"]), + [{file_info, [mode, time]}]), ec_file:remove(filename:join([RelDir, Name++".rel"])), ec_file:remove(filename:join([RelDir, Name++".script"])), {ok, State}; @@ -805,7 +806,8 @@ create_boot_file(RelDir, OutputDir, Options, State, Name) -> ?RLX_ERROR(boot_script_generation_error); {ok, _, []} -> ok = ec_file:copy(filename:join([RelDir, Name++".boot"]), - filename:join([OutputDir, "bin", Name++".boot"])), + filename:join([OutputDir, "bin", Name++".boot"]), + [{file_info, [mode, time]}]), ec_file:remove(filename:join([RelDir, Name++".rel"])), ec_file:remove(filename:join([RelDir, Name++".script"])), {ok, State}; diff --git a/src/rlx_prv_overlay.erl b/src/rlx_prv_overlay.erl index a18699a..645f691 100644 --- a/src/rlx_prv_overlay.erl +++ b/src/rlx_prv_overlay.erl @@ -402,10 +402,8 @@ copy_to(State, FromFile0, ToFile0) -> erlang:iolist_to_binary(filename:join(ToFile1, filename:basename(FromFile1))) end, - case ec_file:copy(FromFile1, ToFile2, [recursive]) of + case ec_file:copy(FromFile1, ToFile2, [recursive, {file_info, [mode, time]}]) of ok -> - {ok, FileInfo} = file:read_file_info(FromFile1), - ok = file:write_file_info(ToFile2, FileInfo), ok; {error, Err} -> ?RLX_ERROR({copy_failed, @@ -494,8 +492,7 @@ write_template(OverlayVars, FromFile, ToFile) -> end, case file:write_file(ToFile, IoData) of ok -> - {ok, FileInfo} = file:read_file_info(FromFile), - ok = file:write_file_info(ToFile, FileInfo), + ok = ec_file:copy_file_info(ToFile, FromFile, [mode, time]), ok; {error, Reason} -> ?RLX_ERROR({unable_to_write, ToFile, Reason}) |