Files
erlang-rebar-obs/0002-Read-vsn-from-file.patch

36 lines
1.2 KiB
Diff
Raw Permalink Normal View History

From fdf0a67adaa06a36d8c0b619c7c265ba7dad5a88 Mon Sep 17 00:00:00 2001
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Date: Wed, 16 Apr 2014 20:25:30 +0400
Subject: [PATCH 2/2] Read vsn from file.
In Open Build Service we don't have git history, all we have is single one revision.
---
src/rebar_utils.erl | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 2d227b6..c85ae1b 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -477,11 +477,12 @@ vcs_vsn_1(Vcs, Dir) ->
end
end.
-vcs_vsn_cmd(git) -> "git describe --always --tags";
-vcs_vsn_cmd(hg) -> "hg identify -i";
-vcs_vsn_cmd(bzr) -> "bzr revno";
-vcs_vsn_cmd(svn) -> "svnversion";
-vcs_vsn_cmd(fossil) -> "fossil info";
+vcs_vsn_cmd(git) -> vcs_vsn_cmd(obs);
+vcs_vsn_cmd(hg) -> vcs_vsn_cmd(obs);
+vcs_vsn_cmd(bzr) -> vcs_vsn_cmd(obs);
+vcs_vsn_cmd(svn) -> vcs_vsn_cmd(obs);
+vcs_vsn_cmd(fossil) -> vcs_vsn_cmd(obs);
+vcs_vsn_cmd(obs) -> "cat .rebar_vsn_obs";
vcs_vsn_cmd({cmd, _Cmd}=Custom) -> Custom;
vcs_vsn_cmd(Version) when is_list(Version) -> {plain, Version};
vcs_vsn_cmd(_) -> unknown.
--
1.8.1.4