summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--rebar.config2
-rw-r--r--rebar.lock4
-rw-r--r--src/rebar_fetch.erl2
-rw-r--r--src/rebar_git_resource.erl16
-rw-r--r--src/rebar_relx.erl6
-rw-r--r--test/rebar_pkg_SUITE.erl2
7 files changed, 17 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml
index 7624db3..b18dc76 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,7 @@ matrix:
- os: linux
otp_release: 18.3
- os: linux
- otp_release: 19.2
+ otp_release: 19.3
- os: osx
language: generic
before_script:
diff --git a/rebar.config b/rebar.config
index c7a2627..7784835 100644
--- a/rebar.config
+++ b/rebar.config
@@ -9,7 +9,7 @@
{bbmustache, "1.3.0"},
{relx, "3.22.4"},
{cf, "0.2.2"},
- {cth_readable, "1.2.5"},
+ {cth_readable, "1.2.6"},
{eunit_formatters, "0.3.1"}]}.
{post_hooks, [{"(linux|darwin|solaris|freebsd|netbsd|openbsd)",
diff --git a/rebar.lock b/rebar.lock
index f8b72e1..a629493 100644
--- a/rebar.lock
+++ b/rebar.lock
@@ -2,7 +2,7 @@
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.3.0">>},0},
{<<"certifi">>,{pkg,<<"certifi">>,<<"0.4.0">>},0},
{<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},0},
- {<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.2.5">>},0},
+ {<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.2.6">>},0},
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.0.0">>},0},
{<<"eunit_formatters">>,{pkg,<<"eunit_formatters">>,<<"0.3.1">>},0},
{<<"getopt">>,{pkg,<<"getopt">>,<<"0.8.2">>},0},
@@ -14,7 +14,7 @@
{<<"bbmustache">>, <<"2010ADAE78830992A4C69680115ECD7D475DD03A72C076BBADDCCBF2D4B32035">>},
{<<"certifi">>, <<"A7966EFB868B179023618D29A407548F70C52466BF1849B9E8EBD0E34B7EA11F">>},
{<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>},
- {<<"cth_readable">>, <<"ED44163CC1FCB79FA1B1C0248D70B542D0DC9A2EE9BF3120320E9A3F71032F09">>},
+ {<<"cth_readable">>, <<"D3DADD65A639F5A54F4F20B9F8D1DB6AD38E3D9FEB836A4A1E29590246D6C860">>},
{<<"erlware_commons">>, <<"087467DE5833C0BB5B3CCDD387F9E9C1FB816A75B7A709629BF24B5ED3246C51">>},
{<<"eunit_formatters">>, <<"7A6FC351EB5B873E2356B8852EB751E20C13A72FBCA03393CF682B8483509573">>},
{<<"getopt">>, <<"B17556DB683000BA50370B16C0619DF1337E7AF7ECBF7D64FBF8D1D6BCE3109B">>},
diff --git a/src/rebar_fetch.erl b/src/rebar_fetch.erl
index 47bfe1d..f5e5db5 100644
--- a/src/rebar_fetch.erl
+++ b/src/rebar_fetch.erl
@@ -46,7 +46,7 @@ download_source_(AppDir, Source, State) ->
{ok, _} ->
ec_file:mkdir_p(AppDir1),
code:del_path(filename:absname(filename:join(AppDir1, "ebin"))),
- ec_file:remove(filename:absname(AppDir1), [recursive]),
+ ok = rebar_file_utils:rm_rf(filename:absname(AppDir1)),
?DEBUG("Moving checkout ~p to ~p", [TmpDir, filename:absname(AppDir1)]),
ok = rebar_file_utils:mv(TmpDir, filename:absname(AppDir1)),
true;
diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl
index 201b8b6..f666d17 100644
--- a/src/rebar_git_resource.erl
+++ b/src/rebar_git_resource.erl
@@ -53,24 +53,22 @@ needs_update(Dir, {git, Url, {branch, Branch}}) ->
needs_update(Dir, {git, Url, "master"}) ->
needs_update(Dir, {git, Url, {branch, "master"}});
needs_update(Dir, {git, _, Ref}) ->
- {ok, Current} = rebar_utils:sh(?FMT("git rev-parse -q HEAD", []),
+ {ok, Current} = rebar_utils:sh(?FMT("git rev-parse --short=7 -q HEAD", []),
[{cd, Dir}]),
Current1 = string:strip(string:strip(Current, both, $\n), both, $\r),
Ref2 = case Ref of
{ref, Ref1} ->
Length = length(Current1),
- if
- Length >= 7 ->
- lists:sublist(Ref1, Length);
- true ->
- Ref1
+ case Length >= 7 of
+ true -> lists:sublist(Ref1, Length);
+ false -> Ref1
end;
- Ref1 ->
- Ref1
+ _ ->
+ Ref
end,
- ?DEBUG("Comparing git ref ~s with ~s", [Ref1, Current1]),
+ ?DEBUG("Comparing git ref ~s with ~s", [Ref2, Current1]),
(Current1 =/= Ref2).
compare_url(Dir, Url) ->
diff --git a/src/rebar_relx.erl b/src/rebar_relx.erl
index 5c653a3..abfb8fc 100644
--- a/src/rebar_relx.erl
+++ b/src/rebar_relx.erl
@@ -26,19 +26,21 @@ do(Module, Command, Provider, State) ->
AllOptions = string:join([Command | Options], " "),
Cwd = rebar_state:dir(State),
Providers = rebar_state:providers(State),
+ RebarOpts = rebar_state:opts(State),
+ ErlOpts = rebar_opts:erl_opts(RebarOpts),
rebar_hooks:run_project_and_app_hooks(Cwd, pre, Provider, Providers, State),
try
case rebar_state:get(State, relx, []) of
[] ->
relx:main([{lib_dirs, LibDirs}
,{caller, api}
- ,{log_level, LogLevel} | output_dir(OutputDir, Options)], AllOptions);
+ ,{log_level, LogLevel} | output_dir(OutputDir, Options)] ++ ErlOpts, AllOptions);
Config ->
Config1 = merge_overlays(Config),
relx:main([{lib_dirs, LibDirs}
,{config, Config1}
,{caller, api}
- ,{log_level, LogLevel} | output_dir(OutputDir, Options)], AllOptions)
+ ,{log_level, LogLevel} | output_dir(OutputDir, Options)] ++ ErlOpts, AllOptions)
end,
rebar_hooks:run_project_and_app_hooks(Cwd, post, Provider, Providers, State),
{ok, State}
diff --git a/test/rebar_pkg_SUITE.erl b/test/rebar_pkg_SUITE.erl
index 30cc0a8..32873c8 100644
--- a/test/rebar_pkg_SUITE.erl
+++ b/test/rebar_pkg_SUITE.erl
@@ -287,7 +287,7 @@ mock_config(Name, Config) ->
unmock_config(Config) ->
meck:unload(),
- ets:delete(?config(mock_table, Config)).
+ catch ets:delete(?config(mock_table, Config)).
copy_to_cache({Pkg,Vsn}, Config) ->
Name = <<Pkg/binary, "-", Vsn/binary, ".tar">>,