[honister,04/22] devupstream: fix handling of SRC_URI

Message ID 0a9ae87c45740ac62b4b0d96eb5bb7de8887d766.1649169646.git.anuj.mittal@intel.com
State Accepted, archived
Commit e62e906a2c3d002628c893fdc6a7d2c31499201a
Headers show
Series [honister,01/22] conf/machine: fix QEMU x86 sound options | expand

Commit Message

Mittal, Anuj April 5, 2022, 2:41 p.m. UTC
From: Ross Burton <ross@burtonini.com>

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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d0edb03088d0d1c20c899daed1bb3a7110b19670)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/classes/devupstream.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/devupstream.bbclass b/meta/classes/devupstream.bbclass
index facc46f3af..ba6dc4136c 100644
--- a/meta/classes/devupstream.bbclass
+++ b/meta/classes/devupstream.bbclass
@@ -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")