|
|
@ -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 |
|
|
|