Le Sun, May 22, 2022 at 04:48:43AM -0300, Juan Picca a écrit :
> Hi Landry.
> 
> > > A proposed solution (patch attached) is the addition of the suffix
> > > ` - ESR` for the `Name` key in the `.desktop` file to diferentiate
> > > between the two menu items.
> >
> > agreed, this totally makes sense. I'm just wondering if it wouldnt be
> > simpler to just append the ESR suffix in post-patch with a sed construct
> > instead of having a large patch that could be annoying to update if a
> > new translation is added/dropped, but then the patch is still needed
> > anyway for the other chunks.
> 
> Yes. I also think using sed/awk is a better alternative.
> Something as:
> 
> ```
> --- Makefile.orig
> +++ Makefile
> @@ -62,6 +62,13 @@
>  DEBUG_CONFIGURE_ARGS +=      --enable-debug-symbols \
>                       --disable-install-strip
> 
> +post-patch:
> +     # Add suffix ` - ESR` to `Name` only in `[Desktop Entry]` section
> +     awk '/^\[/{ if ($$0 == "[Desktop Entry]") flag=1; else flag=0} 
> /^Name/{if (flag) print $$0, "- ESR"; else print} !/^Name/' \
> +             ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop > \
> +             ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop.new
> +     mv ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop.new \
> +             ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop
>  post-install:
>       # install prefs
>       ${INSTALL_DATA_DIR} 
> ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/defaults/preferences
> ```
> ?
> 
> Maybe is a bit ugly?

Nah, it makes sense. But thinking about it a bit more, in post-install
we already use SUBST_DATA on the desktop file; was wondering if we could
do both operations at the same spot in the Makefile for ease of
maintenance. Nice awk oneliner btw :)

If you cant wrap a complete patch (taking care of the other execs to fix
too) I'll try to take care of this in the coming days, poke me if i
forgot.

Landry

Reply via email to