Greg <curtys...@gmail.com> wrote:
> On 2025-02-13, Chris Green <c...@isbd.net> wrote:
> > Max Nikulin <maniku...@gmail.com> wrote:
> >> On 13/02/2025 01:26, Greg Wooledge wrote:
> >> > Now Debian has*two* completely separate
> >> > ways to specify a default application for a role.
> >> 
> >> I believed there are at least 4 ways (besides settings specific to 
> >> particular applications)
> >> - *browser alternatives
> >> - BROWSER environment
> >> - mailcap for text/html
> >> - XDG configuration
> >> 
> >> sensible-browser, "open", and xdg-open just use some of these options.
> >
> > There's also all the MIME confguration.
> 
> Maybe you can see exactly what's going on by examining Epiphany's post install
> script in /var/lib/dpkg/info/.
> 
> For firefox-esr, it's
> 
> #!/bin/sh -e
> 
> if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] ; then
>     update-alternatives --install /usr/bin/x-www-browser \
>         x-www-browser /usr/bin/firefox-esr 70 \
>         --slave /usr/share/man/man1/x-www-browser.1.gz \
>         x-www-browser.1.gz /usr/share/man/man1/firefox-esr.1.gz
>     update-alternatives --remove mozilla /usr/bin/firefox-esr
>     update-alternatives --install /usr/bin/gnome-www-browser \
>         gnome-www-browser /usr/bin/firefox-esr 70 \
>         --slave /usr/share/man/man1/gnome-www-browser.1.gz \
>         gnome-www-browser.1.gz /usr/share/man/man1/firefox-esr.1.gz
> fi
> 
> if [ "$1" = "configure" ] ; then
>     rm -rf /usr/lib/firefox-esr/updates
> fi
> 
> Good luck.

Yes, I was considering doing that.  It's actually very simple:-

    #!/bin/sh
    set -e

    PRIO=85
    for alt in x-www-browser gnome-www-browser; do
        update-alternatives --install \
            /usr/bin/$alt $alt /usr/bin/epiphany-browser $PRIO \
                --slave /usr/share/man/man1/$alt.1.gz $alt.1.gz 
/usr/share/man/man1/epiphany-browser.1.gz
    done

It felt like it had done much more than that though.  If all I have to do
is undo the changes to alternatives then it's not too difficult. I'm back
home now after being away so I should have some time to have a go agt it.


-- 
Chris Green
ยท

Reply via email to