diff mbox series

[blacksail,12/17] lib/oe/recipeutils: honor stable_upgrade for UPSTREAM_CHECK_COMMITS recipes

Message ID f5444604972b8b5a351418d6caf5baf2423fb92b.1792189264.git.yoann.congal@smile.fr
State RFC, archived
Delegated to: Yoann Congal
Headers show
Series [blacksail,01/17] python3-click: depend on python3-shell for shlex | expand

Commit Message

Yoann Congal Oct. 16, 2026, 10:24 p.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

Found running AUH --stable on wrynose: recipes with
UPSTREAM_CHECK_COMMITS set (gnu-config, gn, piglit, etc.) always
reported "-new-commits-available" regardless of stable_upgrade, since
that check ran before stable_upgrade was ever consulted.

AI-Generated: kiro:claude-sonnet-5
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 439d13ce380c099fe6804c14930039da95dcbc3b)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/lib/oe/recipeutils.py | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 99e7bc7acf4..522537e0d96 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -1069,16 +1069,23 @@  def get_recipe_upstream_version(rd, stable_upgrade=False):
     else:
         ud = bb.fetch.FetchData(src_uri, rd)
         if rd.getVar("UPSTREAM_CHECK_COMMITS") == "1":
-            bb.fetch.get_srcrev(rd)
-            upversion = None
-            revision = None
-            try:
-                revision = ud.method.latest_revision(ud, rd, ud.name)
+            if stable_upgrade:
+                # UPSTREAM_CHECK_COMMITS recipes only track git HEAD, not a
+                # version number, so there's no way to filter for a "stable"
+                # release; treat as no update available.
                 upversion = pv
-                if revision != ud.revision:
-                    upversion = upversion + "-new-commits-available"
-            except bb.fetch.FetchError as e:
-                bb.warn("Unable to obtain latest revision: {}".format(e))
+                revision = None
+            else:
+                bb.fetch.get_srcrev(rd)
+                upversion = None
+                revision = None
+                try:
+                    revision = ud.method.latest_revision(ud, rd, ud.name)
+                    upversion = pv
+                    if revision != ud.revision:
+                        upversion = upversion + "-new-commits-available"
+                except bb.fetch.FetchError as e:
+                    bb.warn("Unable to obtain latest revision: {}".format(e))
         else:
             if stable_upgrade:
                 stable_release_regex = rd.getVar("UPSTREAM_STABLE_RELEASE_REGEX")