[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proper dependency on essential package (dpkg) for preinst

Am 28.05.2009 um 20:16 schrieb Helge Kreutzmann:

> On Thu, May 28, 2009 at 07:53:36PM +0200, Sven Joachim wrote:
>> I don't know why this preinst script is necessary, but if you need to
>> insure that the new update-alternatives script is run in it, you have to
>> use Pre-Depends rather than Depends.  See Policy § 7.2.
> Thanks, I missed the last paragraph previously.
> The reason is the following in the preinst (which I inherited, so if
> it is wrong, I gladly rewrite/improve):
> case "$1" in
>   upgrade|install)
>     if ! LC_ALL=C update-alternatives --display asclock 2>&1 | grep 'error: no alternatives' > /dev/null ; then
>       update-alternatives --auto asclock
>       update-alternatives --remove asclock $asclock-4bpp
>       update-alternatives --remove asclock $asclock-8bpp
>       update-alternatives --remove asclock $asclock-24bpp
>     fi
>   ;;
>   abort-upgrade)
>   ;;
>   *)
>     echo "asclock preinst called with an unkown argument: $1" >&2
>     exit 1
>   ;;
> esac

Looking at old asclock versions on archive.debian.net, these lines have
been around at least since potato.  So I think you can safely assume
that the asclock alternatives do not exist anymore and simply ditch the
preinst script altogether.

While we're at it: the prerm script is also cruft.


Reply to: