]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devupstream: fix handling of SRC_URI
authorRoss Burton <ross@burtonini.com>
Tue, 15 Mar 2022 16:23:43 +0000 (16:23 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Mar 2022 10:27:22 +0000 (10:27 +0000)
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>
meta/classes/devupstream.bbclass

index facc46f3af86af651b32811c4830719466109ec8..ba6dc4136c161aaf0d26be546696e4fadcd8b790 100644 (file)
@@ -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")