[oe] [PATCH] classes/gitpv.bbclass: use 'git describe' to for package version

Martin Jansa martin.jansa at gmail.com
Wed Dec 15 19:33:39 UTC 2010


On Wed, Dec 15, 2010 at 12:27:12PM -0200, Otavio Salvador wrote:
> On Wed, Dec 15, 2010 at 11:01, Martin Jansa <martin.jansa at gmail.com> wrote:
> > On Wed, Dec 15, 2010 at 10:50:25AM -0200, Otavio Salvador wrote:
> >> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> >> ---
> >>  classes/gitpv.bbclass |   41 +++++++++++++++++++++++++++++++++++++++++
> >>  1 files changed, 41 insertions(+), 0 deletions(-)
> >>  create mode 100644 classes/gitpv.bbclass
> >>
> >> diff --git a/classes/gitpv.bbclass b/classes/gitpv.bbclass
> >> new file mode 100644
> >> index 0000000..c9496f1
> >> --- /dev/null
> >> +++ b/classes/gitpv.bbclass
> >> @@ -0,0 +1,41 @@
> >> +# gitpv.bbclass provides a PV variable which is a sortable version
> >> +# with the output of "git describe".
> >> +#
> >> +# It can handle SRCREV = ${AUTOREV}, as well as SRCREV = "<hash>"
> >> +
> >> +PV = "${@get_git_pv(d)}"
> >
> > can you integrate it with
> > classes/gitpkgv.bbclass ?
> 
> I can however I think the usage is different.

I find 3 similar classes a bit confusing
gitpkgv, gitver and now gitpv

so I was hoping that all 3 classes could be merged to one (probably
gitver is best name) where all usefull variables will be prepared, and
then only the right one used in recipe.

Like in gitpkgv.bbclass example:
# inherit gitpkgv
#
# PV = "1.0+git${SRCPV}"        
# PKGV = "1.0+git${GITPKGV}"

btw there should be '+gitr' not '+git' AFAIK

in your case, you can use something like
PV = "${GITVER}"

btw your current implementation imho doesn't provide sortable version in
case someone makes tag "something-special" between tags "release-2010.12" and
"release-2011.03".

> The gitpkgv does not use describe and if there's users of it (there's
> no in recipes) we'd change it for them. That is wrong in my opinion.

agreed but it can still be in same bbclass maybe in new variable ?GITTAGVER?
as long as bbclass is not changing variables like PV (and expects recipe
to use provided variables itself).

> about assign to PV ?= I agree however why someone might want to use it
> only in PKGV?

Here is a bit longer thread with reasoning and description
http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg06746.html

Even after converting many recipes from SRCREV to SRCPV I find this
concept nice and if local persistent cache will be still needed in new fetchers 
implementation, then we should probably convert git recipes using SRCPV to
something like GITPKGV (this time hopefully without PE bump).

Regards,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com




More information about the Openembedded-devel mailing list