On 08.11.2013 13:47, Michael Schwendt wrote:
On Thu, 07 Nov 2013 14:10:19 +0100, Sandro Mani wrote:

Well, a Shell Function would be more readable, for example. It would
accept normal arguments to fill in variables -- instead of global RPM
macros, which are substituted in the entire spec file.
Uhm, how can one this be done? Shell variables are substituted after
macro expansion, so i.e.
With the benefit that the function is more readable and more comprehensible
(especially if adding comments) than a global RPM macro. In a Shell function
you could evaluate the arguments and create conditional sections, whereas
in the RPM macro that would get even less readable.

The linked spec is an entertaining exercise, but also an example of
macro-madness. Several values (e.g. paths) are expanded multiple times
instead of defining them once at the beginning and reusing them later. And
the macro is not even fully reusable yet due to hardcoded library file
names.
Well I'm certainly not claiming that it is a generic, package independent macro, and yeah, multiple expansions could be avoided. But as I said, all this was mainly curiosity-driven, not written with excessive care (and not something I would put up for review without further attention).

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Reply via email to