Yocto: Passing in a git Tag to a Recipe

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Yocto: Passing in a git Tag to a Recipe

16,450 次查看
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 

标签 (2)
标记 (1)
0 项奖励
回复
2 回复数

13,268 次查看
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 项奖励
回复

13,268 次查看
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