Re: [PATCH] Allow % as wildcard in the end of PREFERRED_VERSION_pkg


Martin Jansa
 

On Tue, Sep 15, 2009 at 09:11:40AM +0100, Phil Blundell wrote:
On Mon, 2009-09-14 at 00:43 +0200, Martin Jansa wrote:
+def isPreferredVersion(pe, pv, pr, preferred_e, preferred_v, preferred_r):
+ """
+ Check if the version pe,pv,pr is the preferred one.
+ If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%' in the end,
+ """

+ if (pv == preferred_v or (preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]))):
+ if (pr == preferred_r or preferred_r == None):
+ if (pe == preferred_e or preferred_e == None):
+ return true
+ return false
+
I'm not totally comfortable that this patch is semantically well-formed.
If you start allowing wildcards then the idea of "the preferred version"
becomes somewhat ill-defined since, obviously, the wildcard might match
any number of files. I'm not quite sure what the problem is that you
are trying to solve, but my initial reaction is that (whatever the
problem is) it would probably be better solved another way.

p.
I wrote a bit more about my problem here:
http://article.gmane.org/gmane.comp.handhelds.openembedded/25986

Simply:
If I want to prefer bbfile with
PV=1.0+gitr${SRCPV}
then PV will change with every commit
so what PV should be in PREFERRED_VERSION_pkg?

With this patch I can put there "1.0+git%" which will match just this
one bbfile.

--
uin:136542059 jid:Martin.Jansa@...
Jansa Martin sip:jamasip@...
JaMa

Join {openembedded-devel@lists.openembedded.org to automatically receive all group messages.