summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2010-06-22 14:13:39 -0600
committerDave Smith <dizzyd@dizzyd.com>2010-06-22 14:13:39 -0600
commit1f3c49cae7d4ff9744672d8cd799655fef8843e3 (patch)
tree5933d69a697037a7b665c114e3110cc21cdf6219
parent02bc52fc6aaca0ddb66dbe9e586df10ac82c6bce (diff)
Move version check/enforcement for reltool into rebar_reltool; rebar should work (excepting reltool support) with anything as far back as R12, once you've compiled it
-rw-r--r--src/rebar.erl20
-rw-r--r--src/rebar_reltool.erl18
2 files changed, 18 insertions, 20 deletions
diff --git a/src/rebar.erl b/src/rebar.erl
index c00191d..74812f5 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -29,26 +29,6 @@
-export([main/1]).
main(Args) ->
- %% HACK: Make sure the caller is running w/ r13b03 and reltool >= 0.5.2
- case erlang:system_info(version) < "5.7.4" of
- true ->
- io:format("Rebar requires at least erts 5.7.4; this VM is using ~s\n",
- [erlang:system_info(version)]),
- halt(1);
- false ->
- ok
- end,
-
- ReltoolVsn = filename:basename(code:lib_dir(reltool)),
- case ReltoolVsn < "reltool-0.5.2" of
- true ->
- io:format("Rebar requires at least reltool-0.5.2; this VM is using ~s\n",
- [ReltoolVsn]),
- halt(1);
- false ->
- ok
- end,
-
case catch(rebar_core:run(Args)) of
ok ->
ok;
diff --git a/src/rebar_reltool.erl b/src/rebar_reltool.erl
index f427831..23b4146 100644
--- a/src/rebar_reltool.erl
+++ b/src/rebar_reltool.erl
@@ -38,6 +38,9 @@
%% ===================================================================
generate(Config, ReltoolFile) ->
+ %% Make sure we have decent version of reltool available
+ check_vsn(),
+
%% Load the reltool configuration from the file
ReltoolConfig = load_config(ReltoolFile),
@@ -72,6 +75,21 @@ clean(_Config, ReltoolFile) ->
%% Internal functions
%% ===================================================================
+check_vsn() ->
+ case code:lib_dir(reltool) of
+ {error, bad_name} ->
+ ?ABORT("Reltool support requires the reltool application to be installed!", []);
+ Path ->
+ ReltoolVsn = filename:basename(Path),
+ case ReltoolVsn < "reltool-0.5.2" of
+ true ->
+ ?ABORT("Reltool support requires at least reltool-0.5.2; this VM is using ~s\n",
+ [ReltoolVsn]);
+ false ->
+ ok
+ end
+ end.
+
%%
%% Load terms from reltool.config
%%