aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_release.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlx_release.erl')
-rw-r--r--src/rlx_release.erl16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rlx_release.erl b/src/rlx_release.erl
index a84bad3..97187a6 100644
--- a/src/rlx_release.erl
+++ b/src/rlx_release.erl
@@ -38,6 +38,7 @@
application_details/2,
realized/1,
metadata/1,
+ start_clean_metadata/1,
canonical_name/1,
format/1,
format/2,
@@ -172,7 +173,7 @@ realized(#release_t{realized=Realized}) ->
-spec metadata(t()) -> term().
metadata(#release_t{name=Name, vsn=Vsn, erts=ErtsVsn, applications=Apps,
- realized=Realized}) ->
+ realized=Realized}) ->
case Realized of
true ->
{ok, {release, {erlang:atom_to_list(Name), Vsn}, {erts, ErtsVsn},
@@ -181,6 +182,19 @@ metadata(#release_t{name=Name, vsn=Vsn, erts=ErtsVsn, applications=Apps,
?RLX_ERROR({not_realized, Name, Vsn})
end.
+-spec start_clean_metadata(t()) -> term().
+start_clean_metadata(#release_t{name=Name, vsn=Vsn, erts=ErtsVsn, applications=Apps,
+ realized=Realized}) ->
+ case Realized of
+ true ->
+ Kernel = lists:keyfind(kernel, 1, Apps),
+ StdLib = lists:keyfind(stdlib, 1, Apps),
+ {ok, {release, {erlang:atom_to_list(Name), Vsn}, {erts, ErtsVsn},
+ [Kernel, StdLib]}};
+ false ->
+ ?RLX_ERROR({not_realized, Name, Vsn})
+ end.
+
%% @doc produce the canonical name (<name>-<vsn>) for this release
-spec canonical_name(t()) -> string().
canonical_name(#release_t{name=Name, vsn=Vsn}) ->