Skip to contentSkip to conversation

poky-bleeding.bbclass: support recipes with multiple scm SRCREVs

PATCH In review Mikko Rapeli 2 participants 3 messages Apr 4, 2025 – Jun 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 poky-bleeding.bbclass: support recipes with multiple scm SRCREVs

Recipes with multiple repositories in SRC_URI use SRCREV with repo postfix. Set them to AUTOREV too.

---
 meta-poky/classes/poky-bleeding.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta-poky/classes/poky-bleeding.bbclass +5 -0
index 3bfdcf1454..b12aea61b0 100644
@@ -12,6 +12,11 @@ python pokybleeding_version_handler () {
         if "pseudo" in bpn:
             bb.warn("Here 5 %s %s" % (d.getVar("PN"), bpn))
         d.setVar("SRCREV", "${AUTOREV}")
+        srcrev_format = d.getVar("SRCREV_FORMAT")
+        if srcrev_format:
+            for multi_scm in d.getVar("SRCREV_FORMAT").split("_"):
+                if multi_scm != "":
+                    d.setVar("SRCREV_%s" % multi_scm, "${AUTOREV}")
         if "+git" not in d.getVar("PV"):
             d.appendVar("PV", "+git")
 }
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 selftest pokybleeding.py: add test for poky-bleeding.bbclass

The class sets SRCREV to AUTOINC for recipes with single or multiple repositories. Test those cases.

---
 meta/lib/oeqa/selftest/cases/pokybleeding.py | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/pokybleeding.py
meta/lib/oeqa/selftest/cases/pokybleeding.py new file +32 -0
new file mode 100644
index 0000000000..dc12f761b9
@@ -0,0 +1,32 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.selftest.case import OESelftestTestCase
+
+class PokyBleeding(OESelftestTestCase):
+
+    def test_poky_bleeding_autorev(self):
+        """
+        Test that poky-bleeding.bbclass sets SRCREV to "AUTOINC" for recipe
+        with a single scm in SRC_URI and for recipe with two scm's in SRC_URI.
+        """
+
+        self.assertNotEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
+
+        self.assertNotEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
+        self.assertNotEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
+        
+        features = '''
+INHERIT += "poky-bleeding"
+POKY_AUTOREV_RECIPES = "hello-rs mtd-utils-selftest"
+'''
+        self.write_config(features)
+
+        self.assertEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
+
+        self.assertEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
+        self.assertEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
Signature · 1 line
2.43.0
#2 lore raw

Re: [OE-core] [PATCH 2/2] selftest pokybleeding.py: add test for poky-bleeding.bbclass

This was added to meta-yocto repository, rather than oe-core, by mistake I believe.

I'll send a correction.

Alex

Quoted 60 lines · Mikko Rapeli via lists.openembedded.org

The class sets SRCREV to AUTOINC for recipes with single or multiple repositories. Test those cases.

---
 meta/lib/oeqa/selftest/cases/pokybleeding.py | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/pokybleeding.py
meta/lib/oeqa/selftest/cases/pokybleeding.py new file +32 -1
new file mode 100644
index 0000000000..dc12f761b9
@@ -0,0 +1,32 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.selftest.case import OESelftestTestCase
+
+class PokyBleeding(OESelftestTestCase):
+
+    def test_poky_bleeding_autorev(self):
+        """
+        Test that poky-bleeding.bbclass sets SRCREV to "AUTOINC" for recipe
+        with a single scm in SRC_URI and for recipe with two scm's in SRC_URI.
+        """
+
+        self.assertNotEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
+
+        self.assertNotEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
+        self.assertNotEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
+
+        features = '''
+INHERIT += "poky-bleeding"
+POKY_AUTOREV_RECIPES = "hello-rs mtd-utils-selftest"
+'''
+        self.write_config(features)
+
+        self.assertEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
+
+        self.assertEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
+        self.assertEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#214350): https://lists.openembedded.org/g/openembedded-core/message/214350
Mute This Topic: https://lists.openembedded.org/mt/112086625/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-