Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rlx_util:parse_vsn parse integer versions #911

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/rlx_assemble.erl
Original file line number Diff line number Diff line change
Expand Up @@ -663,18 +663,17 @@ include_erts(State, Release, OutputDir, RelDir) ->
ok = rlx_file_utils:copy(ErtsBinDir, LocalErtsBin,
[recursive, {file_info, [mode, time]}]),

case OsFamily of
Result = case OsFamily of
unix ->
DynErl = filename:join([LocalErtsBin, "dyn_erl"]),
Erl = filename:join([LocalErtsBin, "erl"]);
Erl = filename:join([LocalErtsBin, "erl"]),
ok = rlx_file_utils:ensure_writable(Erl),
rlx_file_utils:copy(DynErl, Erl);
win32 ->
DynErl = filename:join([LocalErtsBin, "dyn_erl.ini"]),
Erl = filename:join([LocalErtsBin, "erl.ini"])
ok
end,

ok = rlx_file_utils:ensure_writable(Erl),

case rlx_file_utils:copy(DynErl, Erl) of
case Result of
ok ->
%% drop yielding_c_fun binary if it exists
%% it is large (1.1MB) and only used at compile time
Expand Down
7 changes: 6 additions & 1 deletion src/rlx_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ parse_vsn(Vsn) ->
{match, [Major, Minor, Patch, PreRelease, Build]} ->
{{list_to_integer(Major), list_to_integer(Minor), list_to_integer(Patch)}, {PreRelease, Build}};
_ ->
0
try list_to_integer(Vsn) of
Major ->
{{Major, 0, 0}, {"", ""}}
catch _:_ ->
{{0, 0, 0}, {"", ""}}
end
end.

%% less than or equal to comparison for versions parsed with `parse_vsn'
Expand Down