[PATCH] fetch/wget/_check_latest_version_by_dir: correct iterative check of versioned directories

Alexander Kanavin <[email protected]> Mon, 29 Jun 2026 14:52:26 +0200
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <[email protected]>
From: Alexander Kanavin <[email protected]>

The versioned directories check runs a loop, only considering a directory
if it is bigger or equal to the biggest directory found so far. The
criteria for 'biggest directory found so far' wasn't entirely correct:
it was set even if no valid tarballs were found in it.

This broke libadwaita's version check, when upstream released
1.10.apha (not a valid version) and made a separate directory for it.
1.10 comes ahead of 1.9, and so 1.9 would not be looked into, resulting
in the overall check failing to find any valid versions:

https://download.gnome.org/sources/libadwaita/

This corrects the 'biggest directory' criteria to also include
'contains valid versions'.

I have confirmed that overall oe-core check for latest versions still works
and reports the same versions, except libadwait check which is no longer broken.

Signed-off-by: Alexander Kanavin <[email protected]>
---
 lib/bb/fetch2/wget.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 71667dd2b..141c2d062 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -610,8 +610,7 @@ class Wget(FetchMethod):
                             package, package_regex, current_version, ud, d, filter_regex)
                     if pupver:
                         version[1] = pupver
-
-                    version_dir = version_dir_new
+                        version_dir = version_dir_new
 
         return version[1]
 
-- 
2.47.3