Re: Custom DISTRO_VERSION with git describe


Mikko Rapeli
 

Hi,

On Thu, Apr 28, 2022 at 01:38:35PM +0200, Ayoub Zaki wrote:
I'm also suing dunfell branch, I did a small modification in
my_distro_version.bbclass:

def my_distro_version(d):
import subprocess
project_path = d.getVar('MY_LAYER_BASE', True)
cmd = "git describe --tags"
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
cwd=project_path)
out, err = proc.communicate()
return out.decode("utf-8").rstrip()
MY_DISTRO_VERSION := "${@my_distro_version(d)}"


Then in meta-mylayer/conf/distro/my_distro.conf I used:

INHERIT += "my_distro_version"
DISTRO_VERSION := "${MY_DISTRO_VERSION}"

It seems to be working now :-)
Good! Just a hint that you might want to set SDK_VERSION to the same.

Cheers,

-Mikko

Join yocto@lists.yoctoproject.org to automatically receive all group messages.