aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2014-06-20 09:53:18 +0200
committerJordan Wilberding <[email protected]>2014-06-20 09:53:18 +0200
commit884e227ba2da04fc5a0a2b1ec71ccc27c781ecf3 (patch)
treeb1449c3d88e320058f50f8d2f5f44e197f952727
parentcccd90a7504e74f8c66fb8acbdc686fc22ee39c2 (diff)
parent28c0fff29cb3834532ece53c3c180864c50f37aa (diff)
downloadrelx-884e227ba2da04fc5a0a2b1ec71ccc27c781ecf3.tar.gz
relx-884e227ba2da04fc5a0a2b1ec71ccc27c781ecf3.tar.bz2
relx-884e227ba2da04fc5a0a2b1ec71ccc27c781ecf3.zip
Merge pull request #199 from tsloughter/dialyzer_fixes
dialyzer type fixes
-rw-r--r--src/rlx_depsolver.erl2
-rw-r--r--src/rlx_state.erl22
2 files changed, 12 insertions, 12 deletions
diff --git a/src/rlx_depsolver.erl b/src/rlx_depsolver.erl
index 5d78174..e054cc9 100644
--- a/src/rlx_depsolver.erl
+++ b/src/rlx_depsolver.erl
@@ -119,7 +119,7 @@
-endif.
-opaque t() :: {?MODULE, dep_graph()}.
-type pkg() :: {pkg_name(), vsn()}.
--type pkg_name() :: binary() | atom().
+-type pkg_name() :: string() | binary() | atom().
-type raw_vsn() :: ec_semver:any_version().
-type vsn() :: 'NO_VSN'
diff --git a/src/rlx_state.erl b/src/rlx_state.erl
index d212dcf..ebe6f33 100644
--- a/src/rlx_state.erl
+++ b/src/rlx_state.erl
@@ -27,7 +27,7 @@
new/3,
log/1,
actions/1,
- output_dir/1,
+ output_dir/1,
base_output_dir/1,
base_output_dir/2,
lib_dirs/1,
@@ -93,7 +93,7 @@
goals=[] :: [rlx_depsolver:constraint()],
providers=[] :: [rlx_provider:t()],
available_apps=[] :: [rlx_app_info:t()],
- default_configured_release :: {rlx_release:name(), rlx_release:vsn()} | undefined,
+ default_configured_release :: {rlx_release:name() | undefined, rlx_release:vsn() |undefined} | undefined,
vm_args :: file:filename() | undefined,
sys_config :: file:filename() | undefined,
overrides=[] :: [{AppName::atom(), Directory::file:filename()}],
@@ -135,7 +135,7 @@ new(Config, CommandLineConfig, Targets)
{ok, Root} = file:get_cwd(),
Caller = proplists:get_value(caller, CommandLineConfig, api),
- Log = proplists:get_value(log, CommandLineConfig, ec_cmd_log:new(error, Caller)),
+ Log = proplists:get_value(log, CommandLineConfig, ec_cmd_log:new(error, Caller)),
State0 = #state_t{log=Log,
config_file=Config,
cli_args=CommandLineConfig,
@@ -147,7 +147,7 @@ new(Config, CommandLineConfig, Targets)
default_configured_release=undefined,
configured_releases=ec_dictionary:new(ec_dict),
realized_releases=ec_dictionary:new(ec_dict),
- config_values=ec_dictionary:new(ec_dict)},
+ config_values=ec_dictionary:new(ec_dict)},
State1 = rlx_state:put(State0, default_libs, true),
State2 = rlx_state:put(State1, system_libs, undefined),
State3 = rlx_state:put(State2, overlay_vars, []),
@@ -300,8 +300,8 @@ update_realized_release(M=#state_t{realized_releases=Releases}, Release) ->
Release,
Releases)}.
--spec default_configured_release(t()) ->
- {rlx_release:name() | undefined, rlx_release:vsn() | undefined}.
+-spec default_configured_release(t()) -> {rlx_release:name() | undefined,
+ rlx_release:vsn() | undefined}.
default_configured_release(#state_t{default_configured_release=Def}) ->
Def.
@@ -403,19 +403,19 @@ create_logic_providers(State0) ->
{ConfigProvider, {ok, State1}} = rlx_provider:new(rlx_prv_config, State0),
{DiscoveryProvider, {ok, State2}} = rlx_provider:new(rlx_prv_discover, State1),
{ReleaseProvider, {ok, State3}} = rlx_provider:new(rlx_prv_release, State2),
- {OverlayProvider, {ok, State4}} = rlx_provider:new(rlx_prv_overlay, State3),
- {ActionProviders, State5} = add_providers([release, relup, tar], State4),
+ {OverlayProvider, {ok, State4}} = rlx_provider:new(rlx_prv_overlay, State3),
+ {ActionProviders, State5} = add_providers([release, relup, tar], State4),
State5#state_t{providers=[ConfigProvider, DiscoveryProvider,
ReleaseProvider, OverlayProvider | ActionProviders]}.
-add_providers(Actions, State) ->
+add_providers(Actions, State) ->
add_providers(Actions, [], State).
-add_providers([], Providers, State) ->
+add_providers([], Providers, State) ->
{lists:reverse(Providers), State};
add_providers([Action | T], Providers, State) ->
case lists:member(Action, actions(State)) of
- true ->
+ true ->
{Provider, {ok, State1}} = new_provider(Action, State),
add_providers(T, [Provider | Providers], State1);
false ->