[Rpm-maint] [rpm-software-management/rpm] spec file preprocessing on rpm level (#1472)
Marc-Andre Lureau
notifications at github.com
Thu Jan 27 20:25:35 UTC 2022
> I agree it's limited but so far it was enough to provide dynamically generated specs based on git metadata.
ack
>
> > Also I think `{{{` `}}}` is not the best choice, as it conflicts with variables, something like `%{{{{ to expand}}}}` wouldn't work as expected.
>
> I think this case might be quite hypothetical, i.e. that you would want to work with dynamically named rpm variable? You could do `{{{ echo %{$<something>} }}}` in that case. But it's also possible to make the tags configurable if that was really a problem.
hmm, ok
>
> > Also, what does it bring compared to `%{lua:...}` ? (which could run a bash script if necessary)
>
> %{lua:...} scriplets are evaluated during rpm spec evaluation, here we are talking about an earlier step. If the question is why not use lua language rather than bash for evaluation code inside `{{{ }}}` tags, then I would say, because bash is simpler to use for wider range of people.
Could you explain a little bit the difference between the preproc time and the `%{}` expansion time? Doesn't rpm expand `%{}` repeatedly until no further expansion can be done?
(If there was control flow it would make sense, because then you would have delimited blocks that you would want to process first).
>
> > (btw, `preproc` as a name for such tool, not the best idea)
>
> It is supposed to be a generic text-preprocessing tool, hence preproc. Usage generally is `cat file.txt | preproc`.
Fair enough. I was actually surprised there was no such tool in the coreutils/bash tool belt.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1472#issuecomment-1023609467
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/1472/1023609467 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220127/889a9b61/attachment-0001.html>
More information about the Rpm-maint
mailing list