Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Should packages auto-eselect alternative implementation on removal?
Date: Wed, 30 May 2012 17:01:44
Message-Id: 20120530190124.2fa174c5@pomiocik.lan

There is a number of virtuals in Gentoo which switching active
implementation via eselect. However, most of the packages being
'alternative providers' don't seem to care about eselect at all. Is
that the correct thing to do, or maybe should every package ensure
that after its removal another implementation is eselected
(or a cleanup is done)?

This issue was given my attention through bug 418217 [1]. Long story
short -- there are applications which call pager implicitly. Those are
git & systemd. They don't actually require any pager being installed;
however, if $PAGER is set they use it.

As the reporter shows, after unmerging virtual/pager and last pager
provider, the system is left with an invalid $PAGER setting. Thanks to
that, both systemd & git fail with errors. This can be easily
reproduced by typing (in a git repo):

$ PAGER=foo git log
error: cannot run foo: No such file or directory

In other words, removing a pager leaves system in a broken state.
AFAICS, 'eselect pager' doesn't even support a system without pager --
it just fails miserably. So the user is either forced to install any
pager provider, or remove the env.d file by hand.

Thus, I raise the following issues:

1) eselect modules should probably support not only switching
implementations but disabling any as well. I'll open a bug for
the editor module used here;

2) should all implementation providers call 'eselect ... update' in
postrm()? That seems to be the most reasonable way of ensuring
the system is left in working state.

3) how about semi-official eselect modules, like eselect-sh? I don't
really see all shells depending on it; should the ebuilds check whether
a particular eselect module is installed first?


Best regards,
Michał Górny


File name MIME type
signature.asc application/pgp-signature