#521813 u-a: Please allow hooks after selecting an alternative

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Josselin Mouette
Date:
2015-03-29 00:03:14 UTC
Severity:
wishlist
#521813#5
Date:
2009-03-30 09:02:48 UTC
From:
To:
Package: dpkg
Severity: wishlist

Hi,

Some selections of alternatives require updating some kind of cache.
I have already met such an issue in the past (IIRC with a Python
module), and I see it happening again with an icon, see #516566. In this
case, after selecting the alternative, it will not be effective on the
user’s desktop until the icon cache is regenerated. Not regenerating it
leads to an inconsistency.

Therefore, it would be nice to allow configuring a hook when setting up
an alternative; the hook would have to be run after any manual change in
the selection, avoiding such inconsistencies.

Thanks for considering,

#521813#12
Date:
2009-03-30 14:13:49 UTC
From:
To:
It doesn't seem doable to register the hook when the alternative is
created, the file format has not been created with possible extensions in
mind.

Several questions pops up:

1/ Would running any file trigger based on the path of the modified
alternative solve the problems in both cases you have encountered ?

2/ We could have fixed filesystem-based hooks, i.e. execute any program
in /etc/dpkg/u-a-hooks/ with alternative-specific arguments every time
that an alternative symlink is created or updated. What kind of
granularity should we provide if we go towards this solution ? Should it
be in /etc/dpkg or in /usr/share/dpkg/ or in both ?

Cheers,

#521813#17
Date:
2009-03-30 14:28:43 UTC
From:
To:
Le lundi 30 mars 2009 à 16:13 +0200, Raphael Hertzog a écrit :

Argh :(

Not in the first case, but it was really ugly. Looking back at it, it
should have used another package instead of alternatives. It wouldn’t
work at all today with the upcoming changes in python-support.

For the case I’m looking at currently (gnome-icon-theme), it would work
without any change if you simply activated the corresponding file
trigger, since there is already one here precisely to regenerate the
cache if needed. This looks like a really elegant solution to me.

IMHO that should be /usr/share/dpkg if you go down that route. That
could also be a way to make alternatives more robust, by entirely
migrating to a stateless format where you’d just dump links
in /usr/share/alternatives/alternative-name/priority_name instead of
running update-alternatives in postinst/prerm.

Cheers,

#521813#22
Date:
2009-03-30 15:15:55 UTC
From:
To:
It seems at least logical to go towards this solution in the long term
but I don't think it's currently doable. At least not without
prior-changes to dpkg-trigger.

Guillem, your advice would be welcome here.

Cheers,

#521813#31
Date:
2012-06-16 08:03:18 UTC
From:
To:
Hi Sylvestre,

Sylvestre Ledru wrote:

There is a patch at <http://bugs.debian.org/638236#10>.  Anything
more flexible will require infrastructure that does not exist.
What do you think should be done?

Thanks,
Jonathan