Bug#643602: update-alternatives --set should be disallowed from maintainer scripts

September 27th, 2011 - 07:40 pm ET by Steve Langasek | Report spam
Package: dpkg
Version: 1.16.1
User: debian-dpkg@lists.debian.org
Usertags: update-alternatives

I've recently spent time having to clean up after a package which earlier in
its history called update-alternatives --set from a maintainer script to try
to override a "wrong" alternative... instead of simply removing the wrong
alternative from the system.

This is problematic, of course, because now it's impossible to distinguish
between an alternative that's manually set because the user set it, vs. one
that's manually set because the package set it.

I don't think there's any justification for a package ever calling u-a --set
from a maintainer script. Therefore I propose that this command abort if
$DPKG_MAINTSCRIPT_PACKAGE is set.

Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org



To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 3 repliesReplies Make a reply

Replies

#1 Guillem Jover
September 28th, 2011 - 12:30 am ET | Report spam
tag 643602 wontfix
thanks

Hi!

On Tue, 2011-09-27 at 16:26:10 -0700, Steve Langasek wrote:
I've recently spent time having to clean up after a package which earlier in
its history called update-alternatives --set from a maintainer script to try
to override a "wrong" alternative... instead of simply removing the wrong
alternative from the system.

This is problematic, of course, because now it's impossible to distinguish
between an alternative that's manually set because the user set it, vs. one
that's manually set because the package set it.

I don't think there's any justification for a package ever calling u-a --set
from a maintainer script. Therefore I propose that this command abort if
$DPKG_MAINTSCRIPT_PACKAGE is set.



Hmmm, so while I agree maintainer scripts for packages in Debian (or
I guess Ubuntu) should not be using u-a --set (or --set-selections or
maintainer script is the right answer, because that seems to be a
packaging policy issue. I can see how setting a specific alternative
could be desirable in a local configuration package or another kind of
distribution.

So I think a lintian error would be more appropriate here. It could
even be made so that DAK refuses such uploads, perhaps. I'm tagging
this wontfix for now, and will be closing in the near future if no
other convincing arguments are put forward.

thanks,
guillem



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Similar topics