All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFH] Support for automatic package versining using git describe
@ 2009-02-13  2:32 Otavio Salvador
  2009-02-13  8:59 ` Koen Kooi
  0 siblings, 1 reply; 8+ messages in thread
From: Otavio Salvador @ 2009-02-13  2:32 UTC (permalink / raw)
  To: OpenEmbedded Development Mailing List

Hello,

One of nice features we've been using is the git-describe to get
versions based on tags; many projects are using it to name the
development releases and it does give a better view of how diverged it
from last released version.

So we're looking for a way to use it to generate the PV based on
that. The current git fetcher already has the required support to get
tags, so we can use it as SRCREV, but not yet to use git-describe.

I've tried to implement it, and failed. Here is the current patch just
to reference.

Index: lib/bb/fetch/git.py
===================================================================
--- lib/bb/fetch/git.py (revisão 1150)
+++ lib/bb/fetch/git.py (cópia de trabalho)
@@ -49,10 +49,7 @@
         elif tag:
             ud.tag = tag
 
-        if not ud.tag:
-            ud.tag = self.latest_revision(url, ud, d)  
-
-        if ud.tag == "master":
+        if not ud.tag or ud.tag == "master":
             ud.tag = self.latest_revision(url, ud, d)
 
         ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.tag), d)
@@ -179,6 +176,15 @@
 
         sortable_revision = "%s+%s" % (output.split()[0], ud.tag)
         bb.data.setVar(key, sortable_revision, d)
+
+        if bb.data.getVar("GIT_USE_DESCRIBE", d, False):
+            describe = runfetchcmd("git describe 2> /dev/null").read().strip()
+
+            if describe.empty():
+                bb.data.setVar("GIT_DESCRIBED_VERSION", "0.0.0+gitr%s" % (ud.tag))
+            else:
+                bb.data.setVar("GIT_DESCRIBED_VERSION", describe)
+
         return sortable_revision

Do someone has a better idea how to do that?

TIA,

-- 
Otavio Salvador                  O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-03-06  0:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87iqmp5f58.fsf@neumann.lab.ossystems.com.br>
2009-03-04 18:34 ` [RFH] Support for automatic package versining using git describe Mario Domenech Goulart
2009-03-05 13:43   ` Otavio Salvador
2009-03-05 21:31     ` Mario Domenech Goulart
2009-03-05 21:37       ` Koen Kooi
2009-03-06  0:50       ` Mike (mwester)
2009-02-13  2:32 Otavio Salvador
2009-02-13  8:59 ` Koen Kooi
2009-02-13 10:46   ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.