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

Re: prerm/postrm considered harmful in M-A: same packages



Hi folks,

On Thu, Nov 07, 2013 at 03:37:26PM +0100, Guillem Jover wrote:
> dpkg 1.17.2 will setup DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT to make this
> easier to handle. The aforementioned thread contains recipes on how to
> do proper ref-counting with older dpkg versions.

Thanks for implementing this, Guillem.

I've had a chance to look at using this now in the libpam-cracklib prerm, to
fix bug #647428.  Since dpkg 1.17.2 is newer than what's available in
wheezy, we need to decide on appropriate upgrade handling.

Rather than enforcing a versioned dep on dpkg (>= 1.17.2), which gets in the
way of backports etc., I opted for the following pattern:

if [ "$1" = remove ] && [ "${DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT:-1}" = 1 ];
then
	pam-auth-update --package --remove cracklib
fi

This will still be buggy when called from an older dpkg, but since this is a
removal script that will only be in jessie, it's unlikely to be called until
after dpkg has been upgraded.  And if it is called from an older dpkg, it
will fall back to the previous (recoverable) behavior.

Cheers,
-- 
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

Attachment: signature.asc
Description: Digital signature


Reply to: