summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-22 12:39:36 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-22 12:41:55 +0200
commit3c56fbab6f5d0b87ba21fac828899d20132d5066 (patch)
tree37bbd85bfbc0230f3163ce4bde4641517fe6b390
parent86c69bc253c5a5b4802fcc08aeaed8a02fa8e7b1 (diff)
Restore old reltool vsn check
reltool is missing an app resource file before R14A. Therefore, restore the old check and add TODO.
-rw-r--r--src/rebar_reltool.erl29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/rebar_reltool.erl b/src/rebar_reltool.erl
index 1338a37..79b2a2a 100644
--- a/src/rebar_reltool.erl
+++ b/src/rebar_reltool.erl
@@ -81,20 +81,21 @@ clean(Config, ReltoolFile) ->
%% ===================================================================
check_vsn() ->
- _ = application:load(reltool),
- ReltoolVsn =
- case lists:keysearch(reltool, 1, application:loaded_applications()) of
- {value, {_, _, V}} ->
- V;
- _ ->
- ""
- end,
- case ReltoolVsn < "0.5.2" of
- true ->
- ?ABORT("Reltool support requires at least reltool-0.5.2; "
- "this VM is using ~s\n", [ReltoolVsn]);
- false ->
- ok
+ %% TODO: use application:load and application:get_key once we require
+ %% R14A or newer. There's no reltool.app before R14A.
+ 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.
process_overlay(ReltoolConfig) ->