Massive use of %suse_update_desktop_file macro, how to simplify this?

I managed to build lsp-plugins.

However, recent update brings a lot of .desktop files.

Which I have to add the category to it using these macros, but this looks excessive, I could not figure out the better way to do it.

Any ideas? Thanks.

https://build.opensuse.org/package/show/home:andythe_great:branches:multimedia:apps/lsp-plugins

%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_comp_delay_mono.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_comp_delay_stereo.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_comp_delay_x2_stereo.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_compressor_lr.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_compressor_mono.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_compressor_ms.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_compressor_stereo.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_dyna_processor_lr.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_dyna_processor_mono.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_dyna_processor_ms.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_dyna_processor_stereo.desktop Mixer
%suse_update_desktop_file -r %{buildroot}%{_datadir}/applications/in.lsp_plug.lsp_plugins_expander_lr.desktop Mixer

etc

Hi
Either add a patch to add mixer to all those desktop files or use sed to replace;


find . -name "*.desktop" -exec sed -i 's|<original_text>|<replacement_text>|' {} ";"

Hello,

Are patch and sed more preferable to %suse_update_desktop_file in this case or just a preference?

Hi
Then you are unlikely to need all the macro entries, just %suse_update_desktop_file *.desktop if that…

I tried that however the macros expand into this,

%suse_update_desktop_file -r usr/share/applications/in.lsp_plug.lsp_plugins_comp_delay_mono.desktop usr/share/applications/in.lsp_plug.lsp_plugins_comp_delay_stereo.desktop  usr/share/applications/in.lsp_plug.lsp_plugins_comp_delay_x2_stereo.desktop usr/share/applications/in.lsp_plug.lsp_plugins_compressor_lr.desktop etc 

which %suse_update_desktop_file don’t understand. Let me try again to be sure.

So I check, and indeed the macro expand as stated above. Not possible to use *.desktop with %suse_update_desktop_file.

Hi
Why are you running -r option? Fix the desktop files by either a patch or sed command…

Found this

for desktop in %{buildroot}%{_datadir}/applications/*.desktop; do
%suse_update_desktop_file ${desktop} Mixer
done

Seems to work well.