[Rpm-maint] [rpm-software-management/rpm] Triple operator for conditional shortcut (#115)

pavlinamv notifications at github.com
Thu May 4 11:32:53 UTC 2017


I do not see any possibility how to define sensible syntax of the triple operator, without possible causing problems for macros %{?condition:true} and %{!?condition:false}. Thus I think that adding this macro without additional changes is not a good idea.

The syntax of the macro should start "%{?condition:" or "%{!?condition:"
But then there is a problem with next separator operator:
  E.g if we define syntax
       %{?condition:true!false},
  where separator operator is the first '!' after ':', which is not nested in {} or in ()
  it will change interpretation of macros like
       %{?write_errors: You did not respond! It is a mistake.}
  which will change from its original meaning 
  if "write_errors" is defined, then write "You did not respond! It is a mistake."
  to 
  if "write_errors" is defined, then write "You did not respond" else write " It is a mistake."
 
If we change separator operator from "!" to another character it will not help us a lot. The mentioned type of mistake will still occur. The only characters which are different from rpm point of view are  "{", "}", "(", ")". To use some of them is not a good choice too. The triple operator will look very weird and probably another type of problems occur.

Similarly for a separator operator defined as a sequence of chars.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/115#issuecomment-299160206
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170504/a95bf39f/attachment.html>


More information about the Rpm-maint mailing list