aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric B Merritt <[email protected]>2013-02-05 16:51:03 -0800
committerEric B Merritt <[email protected]>2013-02-06 14:21:32 -0800
commit6299d16b6205edfe3eff396ec72ef8566cfabe67 (patch)
tree0118b6e313a81b88d83ac112a3c71f1eefc2dce1 /src
parent9c88211a86da5812272df0fd0bd82ace3c6232ed (diff)
downloadrelx-6299d16b6205edfe3eff396ec72ef8566cfabe67.tar.gz
relx-6299d16b6205edfe3eff396ec72ef8566cfabe67.tar.bz2
relx-6299d16b6205edfe3eff396ec72ef8566cfabe67.zip
fix problem in release names from discovered releases
Diffstat (limited to 'src')
-rw-r--r--src/rcl_release.erl11
-rw-r--r--src/rcl_util.erl5
2 files changed, 14 insertions, 2 deletions
diff --git a/src/rcl_release.erl b/src/rcl_release.erl
index ea20f1f..97465d0 100644
--- a/src/rcl_release.erl
+++ b/src/rcl_release.erl
@@ -89,7 +89,7 @@
%%============================================================================
-spec new(atom(), string()) -> t().
new(ReleaseName, ReleaseVsn) ->
- #release_t{name=ReleaseName, vsn=ReleaseVsn,
+ #release_t{name=to_atom(ReleaseName), vsn=ReleaseVsn,
annotations=ec_dictionary:new(ec_dict)}.
-spec name(t()) -> atom().
@@ -170,7 +170,7 @@ format(Release) ->
format(Indent, #release_t{name=Name, vsn=Vsn, erts=ErtsVsn, realized=Realized,
goals = Goals, applications=Apps}) ->
BaseIndent = rcl_util:indent(Indent),
- [BaseIndent, "release: ", erlang:atom_to_list(Name), "-", Vsn, "\n",
+ [BaseIndent, "release: ", rcl_util:to_string(Name), "-", Vsn, "\n",
rcl_util:indent(Indent + 1), " erts-", ErtsVsn,
", realized = ", erlang:atom_to_list(Realized), "\n",
BaseIndent, "goals: \n",
@@ -380,3 +380,10 @@ parse_version({AppName, Version, Constraint0, Constraint1})
{AppName, rcl_depsolver:parse_version(Version), Constraint1, Constraint0};
parse_version(Constraint) ->
Constraint.
+
+to_atom(RelName)
+ when erlang:is_list(RelName) ->
+ erlang:list_to_atom(RelName);
+to_atom(Else)
+ when erlang:is_atom(Else) ->
+ Else.
diff --git a/src/rcl_util.erl b/src/rcl_util.erl
index 06d957d..9cb20ac 100644
--- a/src/rcl_util.erl
+++ b/src/rcl_util.erl
@@ -23,6 +23,7 @@
-export([mkdir_p/1,
to_binary/1,
+ to_string/1,
is_error/1,
error_reason/1,
indent/1]).
@@ -56,6 +57,10 @@ to_binary(String) when erlang:is_list(String) ->
erlang:iolist_to_binary(String);
to_binary(Bin) when erlang:is_binary(Bin) ->
Bin.
+to_string(Atom) when erlang:is_atom(Atom) ->
+ erlang:atom_to_list(Atom);
+to_string(Else) when erlang:is_list(Else) ->
+ Else.
%% @doc get the reason for a particular relcool error
-spec error_reason(relcool:error()) -> any().