Results 1 to 8 of 8

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

  1. #1
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

    Default 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/s...ps/lsp-plugins

    Code:
    %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

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

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

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

    Code:
    find . -name "*.desktop" -exec sed -i 's|<original_text>|<replacement_text>|' {} ";"
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

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

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Either add a patch to add mixer to all those desktop files or use sed to replace;

    Code:
    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?

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

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

    Quote Originally Posted by andythe_great View Post
    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....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

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

    Quote Originally Posted by malcolmlewis View Post
    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,

    Code:
    %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.

  6. #6
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

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

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

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

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

    Quote Originally Posted by andythe_great View Post
    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....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

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

    Found this

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

    Seems to work well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •