Open Vogtinator opened 6 years ago
hmm globals with awk are not a really good idea for once.
But yea it should play it safe... Any ideas how to achieve that?
hmm globals with awk are not a really good idea for once.
Feel free to come up with a better idea which doesn't involve lua...
But yea it should play it safe... Any ideas how to achieve that?
Is there already some kind of variable definition order tracking implemented? If not, it might be a bit difficult indeed... Maybe it could try to keep %global at the same position?
No evaluation and tracking in the code yet. Well the globals idea was that they should be used only for when they are not depending on external resources as otherwise it "just works" thanks to the command order, while all other expansions are parsed fully first and then expressed.
@Vogtinator Two choices:
%define
so that it does lazy evaluation%{expand:%{version}}
instead, so that block is forced to lazy evaluation%{expand:%{version}}
will not help. %expand is not about lazy evaluation, but instead it does a re-expansion. This re-expansion happens right away, though.
%version is only defined after
Version:
in the .spec file, which means in combination with %global the order is important.evaluates to
Requires: foo = 1.0
.spec-cleaner converts this to
which evaluates to
Requires: foo = 1.0.5.
as %version is only available after the %global expansion.As a workaround, we switched to
%define
for the time being, but this results in evaluating the command once per macro expansion.