You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/09/23 14:29:17 UTC
[23/50] rebar commit: updated refs/heads/import to 5dea85d
Try one more location for the OTP_VERSION file
If one is building Erlang from sources without making a proper release,
there may be an OTP_VERSION file in the root directory.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/161c3173
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/161c3173
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/161c3173
Branch: refs/heads/import
Commit: 161c3173266a2d3b588cb688a2e231ce523c20d2
Parents: cb004d2
Author: Stavros Aronis <ar...@gmail.com>
Authored: Fri May 29 10:57:27 2015 +0200
Committer: Stavros Aronis <ar...@gmail.com>
Committed: Fri May 29 11:59:33 2015 +0200
----------------------------------------------------------------------
THANKS | 1 +
src/rebar_utils.erl | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/161c3173/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index a205df7..2422310 100644
--- a/THANKS
+++ b/THANKS
@@ -140,3 +140,4 @@ Carlos Eduardo de Paula
Paulo F. Oliveira
Derek Brown
Danil Onishchenko
+Stavros Aronis
http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/161c3173/src/rebar_utils.erl
----------------------------------------------------------------------
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 62446e3..dd5650e 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -413,8 +413,14 @@ otp_release1([$R,N|_]=Rel) when is_integer(N) ->
%% the "\n".
otp_release1(Rel) ->
File = filename:join([code:root_dir(), "releases", Rel, "OTP_VERSION"]),
- {ok, Vsn} = file:read_file(File),
-
+ Vsn = case file:read_file(File) of
+ {ok, V} -> V;
+ {error, enoent} ->
+ FileNotInstalled = filename:join([code:root_dir(),
+ "OTP_VERSION"]),
+ {ok, V} = file:read_file(FileNotInstalled),
+ V
+ end,
%% It's fine to rely on the binary module here because we can
%% be sure that it's available when the otp_release string does
%% not begin with $R.