On Fri, Jun 1, 2012 at 6:07 AM, Jeffrey Johnson <n3...@me.com> wrote:
> I asked 2 very specific questions … the rest is quite important also,
> but I need to understand precisely what properties set:versions have in order
> to implement correctly (and I don't fully understand your reply).
>
> Specifically:
>
>        1) Is the set:versions VERSION independent of the order of the
>        calls to rpmsetAdd()? (you know the routine as set_add())

Completely independent - you can add symbols in any order. The symbols
are then hashed and sorted by their numeric values. The underlying
idea is that a set-version is just a (sorted) set of numbers. You can
add whatever symbol to it, possibly twice, the symbol will be hashed
to a number, in a unique manner, and finally you can get the string
representation of the set of numbers. This involves much fuss under
the hood, but basically, you should think of the set of symbols, which
is just the set of numbers, after each symbol has been hashed
individually.

>        2) Can the set:versions encoding be compared for more than equality?
>        What set/arithmetic property is the basis for the comparison? What
>        circumstances/constraints are there related to
>                        … You cannot always compare
>                set-versions in terms of "greater or equal" (but when you can, 
> it's
>                important).

Set-versions compare as sets. There are Euler diagrams to visaulise
set comparsion, which is an undergraduate matetrial. The idea is that,
real numbers are linear order: you can always tell either V1<V2 or
V1>=V2. Sets are quite another matter: you cannot always apply for
"tertium non datur" (either lt or ge). Which is to say that sets can
be quite different and do not compare easily. The order can be imposed
on the sets, though, by requiring the "greater" sets to have at least
the same elements they compare against (perhaps I'm starting to retell
the undergraduate material, which is not going to last). To sum up,
there IS a mathematical basis behind "Requires: foo >= set:asdf"
dependencies.

> I can of course answer my own questions with try-and-see test cases.
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to