[OE-core] [PATCH 1/2] fetch2/__init__.py: Make get_srcrev output configurable

Otavio Salvador otavio at ossystems.com.br
Mon Feb 2 20:50:07 UTC 2015


On Sat, Jan 31, 2015 at 12:06 PM, Mike Looijmans
<mike.looijmans at topic.nl> wrote:
> From: Mike Looijmans <milo-software at users.sourceforge.net>
>
> The idea here is to support package version numbering similar to gitpkgv in
> meta-openembedded. This commit is the first step towards such functionality.
>
> The original plan was to add a "get_pretty_srcrev" method to the fetcher, as
> per Richard's suggestion [1]. While writing this, I noticed that it would
> become a copy of get_srcrev with only two lines changed. So to create something
> more Pythonic than a boolean argument and conditionals around the calls to the
> fetcher's sortable_revision, I just made the method to be called on the fetcher
> an argument to the method. Defaulting to 'sortable_revision' prevents affecting
> existing code.
>
> Now if the git fetcher were to implement, say 'gitpkgv_revision' one could
> set the following in a recipe:
>   PKGV="1.2+${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"
> and this would yield the same result as gitpkgv's GITPKGV variable.
>
> See for the discussion leading to this change:
> [1] http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100345.html
>
> Signed-off-by: Mike Looijmans <mike.looijmans at topic.nl>

I do enjoyed all the design but the way to set the PKGV.

Maybe we could have a way to do it more transparently? Any idea how?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750



More information about the Openembedded-core mailing list