File 0002-Read-vsn-from-file.patch of Package erlang-rebar

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(-)

Index: rebar-2.6.1+git20150928.365ac64/src/rebar_utils.erl
===================================================================
--- rebar-2.6.1+git20150928.365ac64.orig/src/rebar_utils.erl
+++ rebar-2.6.1+git20150928.365ac64/src/rebar_utils.erl
@@ -628,12 +628,13 @@ vcs_vsn_1(Vcs, Dir) ->
             end
     end.
 
-vcs_vsn_cmd(git)    -> "git describe --always --tags";
-vcs_vsn_cmd(p4)     -> "echo #head";
-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(p4)     -> 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.
openSUSE Build Service is sponsored by