[oe] Use AUTOREV and have revision/commit number in package name?

Martin Jansa martin.jansa at gmail.com
Wed Aug 26 19:55:16 UTC 2009


On Thu, Aug 20, 2009 at 11:46:42AM +0200, Martin Jansa wrote:
> Just out of my curiosity:
> 
> How are PREFERRED_VERSION_pkg supposed to work when I prefer pkg with
> autoreved revision.
> 
> bbfile will be named like pkg_git.bb
> inside will be PV="1.0.0+gitr${SRCPV}" and DEFAULT_PREFERENCE=-1
> 
> I would like to force using this _git version even when there will be
> pkg_1.1.0.bb with PV="1.1.0"
> 
> For fixed revision ie from sane-srcrevs i can bump PREFERRED_VERSION_pkg
> with every revision bump in sane-srcrevs, but it also suboptimal :/.
> 
> With autorev I cannot set PREFERRED_VERSION_pkg at all, if I understand
> it right, because I never know which string will be in ${SRCPV} and
> using just PREFERRED_VERSION_pkg="1.0.0+git" or "git" ends with
> "preferred version is not available". Setting PREFERRED_VERSION_pkg to
> "1.0.0+gitr${SRCPV}" is not expanded and ends with a bit confusing 
> bitbake exception about SRC_URI not referencing some SCM.
> 
> I've asked on IRC and they said that its common practise to remove
> PREFERRED_VERSION_pkg and adjust DEFAULT_PREFERENCE or blacklist all
> other versions (like that with PV="1.1.0").
> 
> Now I solved my problem with updating PV in recipies which weren't
> preferred by bitbake to latest version from all available (moved to
> PV="1.1.0+gitr${SRCPV}" when pkg_1.1.0.bb is commited and removed
> DEFAULT_PREFERENCE=-1.
> 
> Could it be solved better? Something like:
> 1) use .bb file with exact the same PV
> 2) use .bb file where PV starts with the same string as is in
> PREFERRED_VERSION_pkg if exact is not found and print warning.

What about this small patch in attachment?

Is there better character for wildchar ('*')?

For this type of PVs is wildchar usefull only in the end of
PREFERRED_VERSION_pkg, would someone need it somewhere else?

Testing regexp match seems like too much for me, at least because
preferred versions contain '.' now and it would be confusing to use
regexp without escaping them.

Regards,

-- 
uin:136542059                jid:Martin.Jansa at gmail.com
Jansa Martin                 sip:jamasip at voip.wengo.fr 
JaMa                         
-------------- next part --------------
From b65bb3e5bf29c59f2f1da297a89af6c02a1a2a4f Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa at gmail.com>
Date: Wed, 26 Aug 2009 21:49:33 +0200
Subject: [PATCH] Allow % as wildcard in the end of PREFERRED_VERSION_pkg

---
 lib/bb/providers.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index 8970fb3..b2a9fea 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -96,7 +96,7 @@ def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
         for file_set in pkg_pn:
             for f in file_set:
                 pe,pv,pr = dataCache.pkg_pepvpr[f]
-                if preferred_v == pv and (preferred_r == pr or preferred_r == None) and (preferred_e == pe or preferred_e == None):
+                if (pv == preferred_v or (preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]))) and (pr == preferred_r or preferred_r == None) and (pe == preferred_e or preferred_e == None):
                     preferred_file = f
                     preferred_ver = (pe, pv, pr)
                     break
-- 
1.6.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20090826/cd9a918d/attachment-0002.sig>


More information about the Openembedded-devel mailing list