[Rpm-ecosystem] Rich deps syntax finalization

Vít Ondruch vondruch at redhat.com
Tue Aug 25 12:50:46 UTC 2015

Dne 25.8.2015 v 14:11 Florian Festi napsal(a):
> Hi!
> I have been visiting Michael Schröder discussing the syntax for the rich
> deps [1]. There are still a few issues we like to get some input from
> the wider community:
> IF Operator
> ===========
> We concluded that the most important question was what to do with the if
> operator. There are two basic variants that can both be used with
> different symbols: forward and backward [2].
> Forward:
> Requires: (langsupport-es ? foo-lang-es)
> Requires: (langsupport-es ?? foo-lang-es)
> Requires: (langsupport-es then foo-lang-es)
> Requires: (langsupport-es THEN foo-lang-es)
> Requires: (langsupport-es -> foo-lang-es)
> Backward:
> Requires: (foo-lang-es if langsupport-es)
> Requires: (foo-lang-es IF langsupport-es)
> Requires: (foo-lang-es <- langsupport-es)
> With ELSE operand:
> Forward:
> Requires: (pkgB ? pkgA : pkgC)
> Requires: (pkgB ?? pkgA !! pkgC)
> Requires: (pkgB then pkgA else pkgC)
> Requires: (pkgB THEN pkgA ELSE pkgC)
> Backward:
> Requires: (pkgA if pkgB else pkgC)
> Requires: (pkgA IF pkgB ELSE pkgC)
> Semantics for all examples is: foo-lang-es/pkgA is needed if
> langsupport-es/pkgB is installed. pkgC is required instead if
> langsupport-es/pkgB is not installed.
> After a lengthy discussion we are pretty confident that the Python style
> (. IF . [ELSE .]) is the best choice. It gives a clear hint which
> direction the operator works and is more familiar than the implication
> arrows and THEN.

Do I understand it correctly, that the direction is different when you
are using ELSE and without ELSE? E.g. for this case:

Requires: (foo-lang-es if langsupport-es)

I read it as "install foo-lang-es in case langsupport-es is installed".
This is quite common construct, but I really don't understand the else case.

Requires: (foo-lang-es if langsupport-es else foo-lang-generic)

Could you please read it for me? Especially the ternary operator
version, it looks like ternary operator but I am afraid it is not.
Wouldn't it be better to have just the ternary operator syntax? E.g.

Requires: (langsupport-es ? foo-lang-es : foo-lang-generic)


Requires: (langsupport-es ? foo-lang-es : %{nil})

if you don't have alternative to install. Of course this would imply
that also something like the following is allowed:

Requires: (1 ? foo-lang-es : foo-lang-generic)

Requires: (0 ? foo-lang-es : foo-lang-generic)

Requires: (%{nil} ? foo-lang-es : foo-lang-generic)

> As I - as a Python programmer - am pretty biased I am very interested if
> programmers knowing only other languages or package maintainers without
> programming skills can relate to this decision.
> We discussed whether the operators should be upper or lower case or case
> insensitive. So far we think *upper case* is better as is stands out
> between the typically lower case package names. But we are interested on
> second opinions on this, too.

Isn't true that Requires, BuildRequires etc are actually case
insensitive? Wouldn't this be first case sensitive thing in RPM?


More information about the Rpm-ecosystem mailing list