Skip to content

Commit

Permalink
Merge pull request #2191 from michaelklishin/otp-23-master-compat
Browse files Browse the repository at this point in the history
OTP 23 [master] compatibility
  • Loading branch information
tsloughter authored Dec 22, 2019
2 parents 3245324 + b93bb35 commit 1553164
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/r3_hex_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ put(Config, Path, Body) ->
delete(Config, Path) ->
request(Config, delete, Path, undefined).

-ifdef (OTP_RELEASE).
-if(?OTP_RELEASE >= 23).
-compile({nowarn_deprecated_function, [{http_uri, encode, 1}]}).
-endif.
-endif.

%% @private
encode_query_string(List) ->
QueryString =
Expand Down
2 changes: 1 addition & 1 deletion src/r3_hex_tarball.erl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ do_unpack(Files, Output) ->
finish_unpack({error, _} = Error) ->
Error;
finish_unpack(#{metadata := Metadata, files := Files, output := Output}) ->
_Version = maps:get("VERSION", Files),
true = maps:is_key("VERSION", Files),
Checksum = decode_base16(maps:get("CHECKSUM", Files)),
ContentsBinary = maps:get("contents.tar.gz", Files),
case unpack_tarball(ContentsBinary, Output) of
Expand Down
9 changes: 8 additions & 1 deletion src/rebar_git_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ compare_url(Dir, Url) ->
?DEBUG("Comparing git url ~p with ~p", [ParsedUrl, ParsedCurrentUrl]),
ParsedCurrentUrl =:= ParsedUrl.

-ifdef (OTP_RELEASE).
-if(?OTP_RELEASE >= 23).
-compile({nowarn_deprecated_function, [{http_uri, parse, 2},
{http_uri, scheme_defaults, 0}]}).
-endif.
-endif.

parse_git_url(Url) ->
%% Checks for standard scp style git remote
case re:run(Url, ?SCP_PATTERN, [{capture, [host, path], list}, unicode]) of
Expand Down Expand Up @@ -351,7 +358,7 @@ parse_tags(Dir) ->
end.

git_clone_options() ->
Option = case os:getenv("REBAR_GIT_CLONE_OPTIONS") of
Option = case os:getenv("REBAR_GIT_CLONE_OPTIONS") of
false -> "" ; %% env var not set
Opt -> %% env var set to empty or others
Opt
Expand Down
7 changes: 7 additions & 0 deletions src/rebar_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,13 @@ get_http_vars(Scheme) ->
Config = rebar_config:consult_file(GlobalConfigFile),
proplists:get_value(Scheme, Config, OS).

-ifdef (OTP_RELEASE).
-if(?OTP_RELEASE >= 23).
-compile({nowarn_deprecated_function, [{http_uri, parse, 1},
{http_uri, decode, 1}]}).
-endif.
-endif.

set_httpc_options() ->
set_httpc_options(https_proxy, get_http_vars(https_proxy)),
set_httpc_options(proxy, get_http_vars(http_proxy)).
Expand Down

0 comments on commit 1553164

Please sign in to comment.