All of lore.kernel.org
 help / color / mirror / Atom feed
* How to dynamically set PKGV? #yocto #python
@ 2020-01-15 20:38 Bill.Kulp
  2020-01-15 20:50 ` [yocto] " Denys Dmytriyenko
  0 siblings, 1 reply; 2+ messages in thread
From: Bill.Kulp @ 2020-01-15 20:38 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

I have a recipe that builds an application from the master branch of a local git repository.  AUTOREV is working, so the recipe automatically rebuilds whenever the repository is updated.  The source code has its own version number.  I'm wondering if it is possible to grab that version number during the do_compile step, and set the package version based on that?

As a first step, I tried to change the value of PKGV from a bitbake task.

PKGV = "BadBad"
python do_foo () {
d.setVar( "PKGV" , "GoodGood" )
print ( "PKGV set to " + d.getVar( "PKGV" ))
}
addtask foo after do_compile before do_package

However, this did not work - the resulting RPM packages are named "my_package-BadBad-r0.noarch.rpm".  Can anyone suggest a fix, or a different method?

Thanks!

[-- Attachment #2: Type: text/html, Size: 1707 bytes --]

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

* Re: [yocto] How to dynamically set PKGV? #yocto #python
  2020-01-15 20:38 How to dynamically set PKGV? #yocto #python Bill.Kulp
@ 2020-01-15 20:50 ` Denys Dmytriyenko
  0 siblings, 0 replies; 2+ messages in thread
From: Denys Dmytriyenko @ 2020-01-15 20:50 UTC (permalink / raw)
  To: Bill.Kulp; +Cc: yocto

https://www.yoctoproject.org/docs/3.0/ref-manual/ref-manual.html#var-AUTOREV
https://www.yoctoproject.org/docs/3.0/ref-manual/ref-manual.html#var-SRCPV

-- 
Denys


On Wed, Jan 15, 2020 at 12:38:19PM -0800, Bill.Kulp@azuresummit.com wrote:
> I have a recipe that builds an application from the master branch of a local 
> git repository.  AUTOREV is working, so the recipe automatically rebuilds 
> whenever the repository is updated.  The source code has its own version 
> number.  I'm wondering if it is possible to grab that version number during 
> the do_compile step, and set the package version based on that?
> 
> As a first step, I tried to change the value of PKGV from a bitbake task.
> 
> PKGV = "BadBad"
> python do_foo () {
> d.setVar( "PKGV" , "GoodGood" )
> print ( "PKGV set to " + d.getVar( "PKGV" ))
> }
> addtask foo after do_compile before do_package
> 
> However, this did not work - the resulting RPM packages are named 
> "my_package-BadBad-r0.noarch.rpm".  Can anyone suggest a fix, or a different 
> method?
> 
> Thanks!

> 


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

end of thread, other threads:[~2020-01-15 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 20:38 How to dynamically set PKGV? #yocto #python Bill.Kulp
2020-01-15 20:50 ` [yocto] " Denys Dmytriyenko

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.