[packages/rpm-pld-macros] - fix typo in debugsource packages macro - rel 2
Elan Ruusamäe
glen at pld-linux.org
Thu Apr 1 10:05:21 CEST 2021
On 01.04.2021 10:02, Bartek Szady wrote:
>
> Well...
>
> rpm --define '_debugsource_packages 0' --eval
> '%{?%_debugsource_packages:%_debugsource_template}'
>
> worked as I had expected (it evaluated to nothing) not because
> %_debugsource_packages was evaluated to false but because
> %{%_debugsource_packages} was undefined :-(
>
>
> Is there any way to undefine a macro in .rpmmacros ?
you can't use the inline compare with it: %{?foo:xxx}
but you can use this trickery:
1. create variable _foo_bar_%{baz}
2. check for _foo_bar_1
2. nuke _foo_bar_%{baz}
$ grep -r dic /usr/lib/rpm
/usr/lib/rpm/pld/macros:%debuginfocflags %{expand:%%define
__dic_%{?_enable_debug_packages} 1}%{?__dic_1: -gdwarf-4
-fno-debug-types-section -fvar-tracking-assignments
-g2}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
/usr/lib/rpm/pld/macros:%_build_id_links %{expand:%%define
__dic_%{?_enable_debug_packages}
1}%{?__dic_1:compat}%{?__dic_0:none}%{expand:%%undefine
__dic_%{?_enable_debug_packages}}
More information about the pld-devel-en
mailing list