[OE-core] [PATCH] classes: add gitupstream class
Burton, Ross
ross.burton at intel.com
Thu Mar 9 15:02:31 UTC 2017
On 9 March 2017 at 13:03, Richard Purdie <richard.purdie at linuxfoundation.org
> wrote:
> I worry that making it support generic scms may make it fragile and
> hard to extend if we do end up needing to do scm specific work in here
> so I'm torn. Having a class per scm would also be annoying...
>
So I have this so far:
CLASSOVERRIDE = "class-gitupstream"
# TODO doesn't let you gitupstream a native recipe yet
python gitupstream_virtclass_handler () {
# Do nothing if this is inherited, as it's for BBCLASSEXTEND
if "gitupstream" not in (d.getVar('BBCLASSEXTEND') or ""):
bb.error("Don't inherit gitupstream, use BBCLASSEXTEND")
return
variant = d.getVar("BBEXTENDVARIANT")
if variant not in ("target"):
bb.error("Pass the variant when using gitupstream, for example
gitupstream:target")
src_uri = d.getVar("SRC_URI").split()[0]
uri = bb.fetch2.URI(src_uri)
d.setVar("DEFAULT_PREFERENCE", "-1")
if uri.scheme == "git":
d.setVar("S", "${WORKDIR}/git")
elif uri.scheme == "svn":
d.setVar("S", "${WORKDIR}/" + uri.params["module"])
# Modify the PV if the recipe hasn't already overridden it
pv = d.getVar("PV")
proto_marker = "+" + uri.scheme
if proto_marker not in pv:
d.setVar("PV", pv + proto_marker + "${SRCPV}")
}
addhandler gitupstream_virtclass_handler
gitupstream_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
(obviously s/gitupstream/devupstream/ still needs to happen)
It's useful in that it adjust S automatically for svn fetches, but the
problem is that bitbake looks for svn: URIs too early and so this doesn't
cause subversion-native to be built.
I'm thinking I'll finish renaming this to devupstream, remove the svn
specific part, and make a note about attempting to fix the fetcher problem.
Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170309/ab9e4476/attachment-0002.html>
More information about the Openembedded-core
mailing list