Yocto: Passing in a git Tag to a Recipe

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Yocto: Passing in a git Tag to a Recipe

12,528 Views
dougbailey
Contributor III

I have a recipe that uses a git repo for source code.

Typically while developing, I simply set the SRCREV = "${AUTOREV}" so I retrieve the tip of the branch I am working on.

There are other times where I want to specify a tag in the repo to use instead of the tip. I would like to do this by specifying the tag in local.conf and then checking to see if the tag variable is set in the actual recipe.


Say I set the following in local.conf
BUILDTAG="V1.0"

In my recipe, I would like to set something like:

if len('BUILDTAG') > 0
    SRCREV=${BUILDTAG}
else
    SRCREV=${AUTOREV}
fi

Is it possible to do something like this?
Is there a better way to do it?

Regards, 

Doug Bailey 

Labels (2)
Tags (1)
0 Kudos
2 Replies

9,346 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Doug Bailey,

In theory, it should work. Have you tried it yet?

I’m not sure if there is a standard or recommended way to do it.  OtavioSalvador, would you know if there’s a convention on how to achieve this in Yocto?

Regards,

0 Kudos

9,346 Views
OtavioSalvador
Senior Contributor II

We did solve this problem at O.S. Systems making it easy to centralize all the revisions on a single file and control if the revisions are taken from this file or AUTOREV for development.

It is public at code.ossystems Code Review - meta-ossystems-base.git/blob - classes/ossystems-srcrev-handler.bbclass