diff options
-rw-r--r-- | dialyzer_reference | 2 | ||||
-rw-r--r-- | src/rebar_utils.erl | 60 | ||||
-rw-r--r-- | xref_reference | 2 |
3 files changed, 32 insertions, 32 deletions
diff --git a/dialyzer_reference b/dialyzer_reference index be486b5..2125ee2 100644 --- a/dialyzer_reference +++ b/dialyzer_reference @@ -1,2 +1,2 @@ -rebar_utils.erl:163: Call to missing or unexported function escript:foldl/3 +rebar_utils.erl:151: Call to missing or unexported function escript:foldl/3 diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 787264c..1222adc 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -42,7 +42,7 @@ find_executable/1, prop_check/3, expand_code_path/0, - deprecated/4, deprecated/5, + deprecated/3, deprecated/4, expand_env_variable/3, vcs_vsn/2, get_deprecated_global/3]). @@ -110,18 +110,6 @@ sh(Command0, Options0) -> ErrorHandler(Command, Err) end. -%% We do the shell variable substitution ourselves on Windows and hope that the -%% command doesn't use any other shell magic. -patch_on_windows(Cmd, Env) -> - case os:type() of - {win32,nt} -> - "cmd /q /c " ++ lists:foldl(fun({Key, Value}, Acc) -> - expand_env_variable(Acc, Key, Value) - end, Cmd, Env); - _ -> - Cmd - end. - find_files(Dir, Regex) -> find_files(Dir, Regex, true). @@ -240,17 +228,45 @@ get_deprecated_global(OldOpt, NewOpt, When) -> undefined -> undefined; Old -> - deprecated(OldOpt, OldOpt, NewOpt, When), + deprecated(OldOpt, NewOpt, When), Old end; New -> New end. +deprecated(Old, New, Opts, When) -> + case lists:member(Old, Opts) of + true -> + deprecated(Old, New, When); + false -> + ok + end. + +deprecated(Old, New, When) -> + io:format( + <<"WARNING: deprecated ~p option used~n" + "Option '~p' has been deprecated~n" + "in favor of '~p'.~n" + "'~p' will be removed ~s.~n~n">>, + [Old, Old, New, Old, When]). + %% ==================================================================== %% Internal functions %% ==================================================================== +%% We do the shell variable substitution ourselves on Windows and hope that the +%% command doesn't use any other shell magic. +patch_on_windows(Cmd, Env) -> + case os:type() of + {win32,nt} -> + "cmd /q /c " ++ lists:foldl(fun({Key, Value}, Acc) -> + expand_env_variable(Acc, Key, Value) + end, Cmd, Env); + _ -> + Cmd + end. + expand_sh_flag(return_on_error) -> {error_handler, fun(_Command, Err) -> @@ -332,22 +348,6 @@ emulate_escript_foldl(Fun, Acc, File) -> Error end. -deprecated(Key, Old, New, Opts, When) -> - case lists:member(Old, Opts) of - true -> - deprecated(Key, Old, New, When); - false -> - ok - end. - -deprecated(Key, Old, New, When) -> - io:format( - <<"WARNING: deprecated ~p option used~n" - "Option '~p' has been deprecated~n" - "in favor of '~p'.~n" - "'~p' will be removed ~s.~n~n">>, - [Key, Old, New, Old, When]). - vcs_vsn_cmd(git) -> %% Explicitly git-describe a committish to accommodate for projects %% in subdirs which don't have a GIT_DIR. In that case we will diff --git a/xref_reference b/xref_reference index c723da8..8a040b8 100644 --- a/xref_reference +++ b/xref_reference @@ -1,2 +1,2 @@ ==> rebar (xref) -src/rebar_utils.erl:157: Warning escript_foldl/3 calls undefined function escript:foldl/3 +src/rebar_utils.erl:145: Warning escript_foldl/3 calls undefined function escript:foldl/3 |