Re: RFC: Feature macros (aka USE flags)

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

 



Le mardi 28 avril 2020 à 08:43 +0200, Petr Pisar a écrit :
> On Mon, Apr 27, 2020 at 04:33:52PM +0200, Petr Šabata wrote:
> > 
> > %_use_ncurses %{lua:
> > if rpm.expand("%{name}") == "yourpackage1"
> >   or rpm.expand("%{name}") == "yourpackage2" then
> >   print(rpm.expand("%{bcond_with foo}%{with foo}"))
> > else
> >   print(rpm.expand("%{bcond_without foo}%{with foo}"))
> > end
> > }

%{name} use in macro logic is unsafe because %{name} does not exist in
the preamble before the Name: line, and the Name: line does not exist
before you start declaring package headers.

Once you’re in package
header declaration mode rpm parser behaviour will prevent you from
doing logic between headers blocks, so it all needs interleaving, which
ends un not possible sanely in any semi-complex spec file.

The rpm parser will now insult you with messages like
warning: undefined macro(s) in %{_sourcedir}: /var/lib/builder/rpmbuild/SOURCES/%{name}

if you try to use %{name} at the srpm level.

This is an rpm 4.15 change
https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/83

Regards,

-- 
Nicolas Mailhot
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-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/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux