RPM's macro expansion has a maximum depth of 16.
I'm now playing a kind of code golf, to fit as much expansion into these 16 levels.
The problem: with "%define pythons python2 python3 pypy3", expand "%{python_module foo}" => "python2-foo python3-foo pypy3-foo".
This must fit into one line and can't use shell or Lua, because it also targets a non-RPM spec parser that doesn't have these features.
Fit as many pythons as you can!
I *could* get to 2 levels per python, if i didn't mind that the recursion never stops....
...which doesn't actually matter in RPM. It's some sort of error somewhere in the log, but the output is the right thing.
bad news: it cares.
well it doesn't, but will replace my very pretty expansion with "MACRO", which is, uh, not what I want.
holy fuck what a hack.
now to see if that other spec parser cares.
(it's this one: https://github.com/openSUSE/obs-build/blob/master/Build/Rpm.pm#L194 )