RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Generalizing EVR comparison precedence, preliminaries

From: Michael Jennings <mej@kainx.org>
Date: Tue 06 Jan 2009 - 20:03:16 CET
Message-ID: <20090106190315.GA733@kainx.org>
On Friday, 02 January 2009, at 19:49:38 (+0100),
Ralf S. Engelschall wrote:

> Ah, yes, you're right. Here is the fixed version:
> 
>     # STEP 1: Match the string and capture regex parts
>     #                      2          3           5             7
>     #                      X     ":"  X        "-"X          ":"X
>     %evr_tuple_match  ^(([^:-]+):)?([^:-]+)(-([^:-]+))?(:([^:-]+))?$
> 
>     # STEP 2: Assemble <E,V,R,D> tuple from regex parts
>     # <E,V,R,D>       case 1:  case 2:  case 3:  case 4:  case 5:  case 6:
>     #                 X:X-X:X  X:X-X    X:X      X:       X-X      X
>     %evr_tuple_select 2357     235_     23__     2___     _35_     __5_
> 
>     # STEP 3: Configure the comparison order of the <E,V,R,D> tuple elements
>     %evr_tuple_order  EVRD
> 
> > There's also a (possible) ambiguity in case 3 "X:X" or a missing case 7
> > candidate as "X::X". yawn ...
> 
> Yes, "X:X" is actually "E:V", the "X::X" for "E::D" (if this is wished
> by you to be supported) then has to be case 7. Here it is:
> 
>     # STEP 1: Match the string and capture regex parts
>     #                      2          3           5             7
>     #                      X     ":"  X        "-"X          ":"X
>     %evr_tuple_match  ^(([^:-]+):)?([^:-]+)(-([^:-]+))?(:([^:-]+))?$
> 
>     # STEP 2: Assemble <E,V,R,D> tuple from regex parts
>     # <E,V,R,D>       case 1:  case 2:  case 3:  case 4:  case 5:  case 6:  case 7:
>     #                 X:X-X:X  X:X-X    X:X      X:       X-X      X        X::X
>     %evr_tuple_select 2357     235_     23__     2___     _35_     __5_     2__7
> 
>     # STEP 3: Configure the comparison order of the <E,V,R,D> tuple elements
>     %evr_tuple_order  EVRD

So a standalone number is just a release?  Shouldn't that be a
version?  (i.e., _3__ for case 6)

And isn't there an ambiguity with E:V vs. V:D?  What about V-R:D? or
just :D?

Michael

-- 
Michael Jennings (a.k.a. KainX)  http://www.kainx.org/  <mej@kainx.org>
Linux Server/Cluster Admin, LBL.gov       Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
 "When I hear about people making vast fortunes without doing any
  productive work or contributing anything to society, my reaction is,
  'How do I get in on that?'"                            -- Dave Barry
Received on Tue Jan 6 20:03:19 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.