devupstream: fix handling of SRC_URI
PATCH 1/3 devupstream: fix handling of SRC_URI
As the class handler runs before overrides are actually applied we need to check both SRC_URI:class-devupstream and SRC_URI, otherwise the automatic assignment of S="${WORKDIR}/git" for git repositories does not work if the base recipe uses http: but :class-devupstream has a git://
entry instead.
Also, there's no need to set S:class-devupstream, we can just assign to S here.
--- meta/classes/devupstream.bbclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/devupstream.bbclass +3 -2
@@ -30,10 +30,11 @@ python devupstream_virtclass_handler () { # Develpment releases are never preferred by default d.setVar("DEFAULT_PREFERENCE", "-1") - uri = bb.fetch2.URI(d.getVar("SRC_URI").split()[0]) + src_uri = d.getVar("SRC_URI:class-devupstream") or d.getVar("SRC_URI") + uri = bb.fetch2.URI(src_uri.split()[0]) if uri.scheme == "git" and not d.getVar("S:class-devupstream"): - d.setVar("S:class-devupstream", "${WORKDIR}/git") + d.setVar("S", "${WORKDIR}/git") # Modify the PV if the recipe hasn't already overridden it pv = d.getVar("PV")
Signature · 1 line
2.25.1
PATCH 2/3 lttng-modules: remove redundant devupstream assignments
These are set by devupstream, so they don't need to be set in the recipe.
--- meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb | 5 ----- 1 file changed, 5 deletions(-)
meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb +0 -5
@@ -42,11 +42,6 @@ python do_package:prepend() { } BBCLASSEXTEND = "devupstream:target" -LIC_FILES_CHKSUM:class-devupstream = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4" -DEFAULT_PREFERENCE:class-devupstream = "-1" SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13" - SRCREV:class-devupstream = "7584cfc04914cb0842a986e9808686858b9c8630" -PV:class-devupstream = "2.13.1+git${SRCPV}" -S:class-devupstream = "${WORKDIR}/git" SRCREV_FORMAT ?= "lttng_git"
Signature · 1 line
2.25.1
Re: [OE-core] [PATCH 2/3] lttng-modules: remove redundant devupstream assignments
Quoted 13 lines · Ross Burton
These are set by devupstream, so they don't need to be set in the recipe.
Signed-off-by Ross Burton <[email protected]>--- meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb | 5 ----- 1 file changed, 5 deletions(-)meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb +0
-0@@ -42,11 +42,6 @@ python do_package:prepend() { }
meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb python do_package:prepend() { · line 47
Quoted 10 lines
meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb +0
-5BBCLASSEXTEND = "devupstream:target" -LIC_FILES_CHKSUM:class-devupstream = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4" -DEFAULT_PREFERENCE:class-devupstream = "-1" SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13" - SRCREV:class-devupstream = "7584cfc04914cb0842a986e9808686858b9c8630" -PV:class-devupstream = "2.13.1+git${SRCPV}" -S:class-devupstream = "${WORKDIR}/git" SRCREV_FORMAT ?= "lttng_git"
I think you need to leave PV?
Cheers,
Richard
Re: [OE-core] [PATCH 2/3] lttng-modules: remove redundant devupstream assignments
Quoted 6 lines · Richard Purdie
meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb python do_package:prepend() { · line 47
Quoted 4 lines
SRCREV:class-devupstream = "
7584cfc04914cb0842a986e9808686858b9c8630"meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb +0
-2-PV:class-devupstream = "2.13.1+git${SRCPV}" -S:class-devupstream = "${WORKDIR}/git" SRCREV_FORMAT ?= "lttng_git"I think you need to leave PV?
devupstream should be setting PV automatically:
if proto_marker not in pv and not d.getVar("PV:class-devupstream"):
d.setVar("PV", pv + proto_marker + "${SRCPV}")
I can double check shortly.
Ross
Re: [OE-core] [PATCH 2/3] lttng-modules: remove redundant devupstream assignments
Quoted 9 lines · Ross Burton
Quoted 6 lines · Richard Purdie
meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb python do_package:prepend() { · line 47
Quoted 4 lines
SRCREV:class-devupstream = "
7584cfc04914cb0842a986e9808686858b9c8630"meta/recipes-kernel/lttng/lttng-modules_2.13.1.bb +0
-2-PV:class-devupstream = "2.13.1+git${SRCPV}" -S:class-devupstream = "${WORKDIR}/git" SRCREV_FORMAT ?= "lttng_git"I think you need to leave PV?
Quoted 6 lines
devupstream should be setting PV automatically:
if
proto_markernot in pv and notd.getVar("PV:class-devupstream"):
d.setVar("PV", pv + proto_marker + "${SRCPV}")I can double check shortly.
Sorry, you're right. I swear I looked at the class and didn't see that!
I think I was looking for "git" instead of url.scheme.
Cheers,
Richard
PATCH 3/3 linux-yocto: remove redundant devupstream assignments
In reply to Ross BurtonThese are set by devupstream, so they don't need to be set in the recipe.
--- meta/recipes-kernel/linux/linux-yocto_5.15.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-kernel/linux/linux-yocto_5.15.bb +0 -1
@@ -30,7 +30,6 @@ SRCREV_meta ?= "ea948a0983d7b7820814e5bce4eda3079201bd95" # meta SRCREV as the linux-yocto-standard builds. Select your version using the # normal PREFERRED_VERSION settings. BBCLASSEXTEND = "devupstream:target" -DEFAULT_PREFERENCE:class-devupstream = "-1" SRCREV_machine:class-devupstream ?= "8993e6067f263765fd26edabf3e3012e3ec4d81e" PN:class-devupstream = "linux-yocto-upstream" KBRANCH:class-devupstream = "v5.15/base"
Signature · 1 line
2.25.1