> The exact syntax is subject to endless bikeshedding of course, but one thing 
> that strikes me as just wrong are the surrounding spaces everywhere. There 
> are no "courtesy spaces" for readability anywhere in rpm macros, I dont think 
> this should be any different. 

Here are 2 relevant examples from the current spec files (the most frequently 
used):
```%global with_lua %{?_without_lua: 0} %{?!_without_lua: 1}```
```%{?gitdate:%{gitdate}}%{?!gitdate:%{version}}```

Without "courtesy spaces" the whole triple conditional macro looks:
```%global with_lua %{?{_without_lua}:0:1}```
```%{?{gitdate}:%{gitdate}:%{version}}```

But with spaces it looks better:
```%global with_lua %{?{_without_lua} : 0 : 1}```
```%{?{gitdate} : %{gitdate} : %{version}}```


Note that inside conditionally expanded macros packagers tend to use spaces 
after ':' even if there are not supported. Thus it looks that packagers prefer 
to use spaces that help to have the macro readable.

> This also makes me wonder if it's really worth the added complexity, it's 
> merely syntactic sugar afterall.

It is a syntactic sugar, but it will help to improve packager experience with 
spec files.

> Any particular reason for this specific syntax over the others discussed in 
> the ticket?

I asked several packagers and this was the preferred syntax.  FYI remaining 
possibilities are 
```%{? {_without_lua} : 0 ! 1 }```
```%{? {_without_lua} ? 0 ! 1 }```
```%{? {_without_lua} ? 0 : 1 }```
```%{?: _without_lua : 0 : 1 }```
```%{? _without_lua ?  0 : 1 }```

> Oh and to make it clear, this is strictly 4.16 material, we don't want 
> changes this drastic at this point in 4.15 cycle, so there's all the time in 
> the world for review and further discussion.

I have a deadline - 4th October.

-- 
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/pull/746#issuecomment-509658688
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to