1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

devel/relx: fix usage of {include_erts,true} (GitHub pull request #565).

This commit is contained in:
Jimmy Olgeni 2017-02-11 15:57:06 +00:00
parent a4d4b29648
commit f3e56928d6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=433885
2 changed files with 38 additions and 0 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= relx
PORTVERSION= 3.22.2
PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= devel
MASTER_SITES+= LOCAL/olgeni:deps \

View File

@ -0,0 +1,37 @@
--- src/rlx_prv_assembler.erl.orig 2016-12-27 16:21:42 UTC
+++ src/rlx_prv_assembler.erl
@@ -121,7 +121,10 @@ format_error({start_clean_script_generat
rlx_util:indent(2), Module:format_error(Errors)];
format_error({strip_release, Reason}) ->
io_lib:format("Stripping debug info from release beam files failed becuase ~s",
- [beam_lib:format_error(Reason)]).
+ [beam_lib:format_error(Reason)]);
+format_error({rewrite_app_file, AppFile, Error}) ->
+ io_lib:format("Unable to rewrite .app file ~s due to ~p",
+ [AppFile, Error]).
%%%===================================================================
%%% Internal Functions
@@ -255,13 +258,16 @@ rewrite_app_file(State, App, TargetDir)
,AppData2
,{modules, OldModules -- ExcludedModules})
end,
- Spec = io_lib:format("~p.\n", [{application, AppName, AppData3}]),
- write_file_if_contents_differ(AppFile, Spec).
+ Spec = [{application, AppName, AppData3}],
+ case write_file_if_contents_differ(AppFile, Spec) of
+ ok -> ok;
+ Error -> ?RLX_ERROR({rewrite_app_file, AppFile, Error})
+ end.
-write_file_if_contents_differ(Filename, Bytes) ->
- ToWrite = iolist_to_binary(Bytes),
- case file:read_file(Filename) of
- {ok, ToWrite} ->
+write_file_if_contents_differ(Filename, Spec) ->
+ ToWrite = io_lib:format("~p.\n", Spec),
+ case file:consult(Filename) of
+ {ok, Spec} ->
ok;
{ok, _} ->
file:write_file(Filename, ToWrite);