Skip to contentSkip to conversation

lib: Fix not selecting the newest version from the versions that match the wildcard-preferred version

PATCH In review Henry Chang 2 participants 2 messages Apr 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: Fix not selecting the newest version from the versions that match the wildcard-preferred version

Same issue can be found here: https://patchwork.openembedded.org/patch/108877/

Quote:

Quoted 11 lines

I have two recipes within a single layer:

stblinux_3.14-1.7.bb
stblinux_3.14-1.8.bb

If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets selected instead.

Reversing the order of files stored in pkg_pn[pn] seems to help. Is it a reasonable solution?

---
 lib/bb/providers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/providers.py +1 -1
index 81459c36..7ec0e025 100644
@@ -133,7 +133,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
             preferred_r = None
 
         for file_set in pkg_pn:
-            for f in file_set:
+            for f in reversed(file_set):
                 pe, pv, pr = dataCache.pkg_pepvpr[f]
                 if preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
                     preferred_file = f
Signature · 1 line
2.25.0
#1 lore raw
Quoted 18 lines · Henry Chang

Same issue can be found here:
https://patchwork.openembedded.org/patch/108877/

Quote:

Quoted 13 lines

I have two recipes within a single layer:

stblinux_3.14-1.7.bb
stblinux_3.14-1.8.bb

If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect
the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets selected instead.

Reversing the order of files stored in pkg_pn[pn] seems to help. Is it
a reasonable solution?

It is a reasonable solution however:

a) It won't work for 3.14-1.7 and 3.14-1.10
b) I'd like to see new tests added to bitbake-selftest for this please so we can ensure we don't regress in future.

Thanks,

Richard