Re: Macronize %py3_shebang_fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le mercredi 06 mai 2020 à 13:44 +0200, Miro Hrončok a écrit :
Hi, Miro

> As a side not, is it possible to have conditonal expansion not expand
> on empty macro?
> 
> If not, we'll advise the users to undefine when they want "empty
> flags".

That won’t work if you need to build upon those macros in the future
lua-side. The official documented rpm lua API does not contain
undefine, just define.

Because of this, in my own Fedora macro sets, unsetting already set
variables safely, or emptying them, is done with
   rpm.define(rpmvar .. " %{nil}")

And the test to check if a variable is free to be set, is checking if
"%{foo}" expands to "%{foo}". Anything else means something else
already touched the variable in the spec file and the result should
best be left alone.

Macros that consume the result then have to use rpm.expand("%{?foo}")
as input. Which seems to work as expected in all cases.

Regards,

-- 
Nicolas Mailhot
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux