[bitbake-devel] lib: Fix not selecting the newest version from the versions that match the wildcard-preferred version

Submitted by Henry Chang on April 6, 2020, 7:04 a.m. | Patch ID: 171722

Details

Message ID 20200406070428.6918-1-mr.changyuheng@gmail.com
State New
Headers show

Commit Message

Henry Chang April 6, 2020, 7:04 a.m.
Same issue can be found here: https://patchwork.openembedded.org/patch/108877/

Quote:
> 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?

Signed-off-by: Henry Chang <mr.changyuheng@gmail.com>
---
 lib/bb/providers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index 81459c36..7ec0e025 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -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

Comments

Richard Purdie April 6, 2020, 2:21 p.m.
On Mon, 2020-04-06 at 15:04 +0800, Henry Chang wrote:
> Same issue can be found here: 
> https://patchwork.openembedded.org/patch/108877/
> 
> Quote:
> > 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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11247): https://lists.openembedded.org/g/bitbake-devel/message/11247
Mute This Topic: https://lists.openembedded.org/mt/72806967/3617530
Group Owner: bitbake-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-