severity 701224 serious
thanks

recently, im-switch 1.23 has migrated to testing while fixing serious
bug "Disable hook script if package is removed.  Closes: #701181"

(I was going to ask release exception later but somehow unblocked.)

This bug is essentially the same bug as #701181 thus I move this to
serious.  These are both maintained by the same maintainer and this is
done as a coordinated migration.

Hi,

On Sat, Feb 23, 2013 at 10:11:19PM +0100, Gunnar Hjalmarsson wrote:
> On 2013-02-23 16:58, Osamu Aoki wrote:
> > I think if I update this, I need to add new hush number for new
> > im-switch to ensure automatic erase.
> 
> Why not drop the md5sum check as regards 80im-switch and use the
> attached file as is instead?

We can consider im-switch and im-config almost a different version of
one package but they are not really the same package.  Then we are
hitting policy violation issue.  Unless this is the only solution, I
will consider this option.  I mean why take chances.
 
> As Iain Lane pointed out at the Ubuntu bug report, if im-config deletes
> the file, and the user at a later point of time decides to go back to
> im-switch (for some reason), 80im-switch won't be reinstalled, and the
> user is faced with an issue that may be hard to track down.

I think 80im-switch get installed but ... let's not argue this point
now.

> Now when that line has been added to 80im-switch in the normal way, you
> can say that with the file I propose, all debian/postinst would do is
> adding a line to 80im-switch that would otherwise have been added at
> next update. It does no harm in any way.

This is what I was thinking ...

> If the policy still makes you hesitate, you should bear in mind that it
> was scarcely written with this special case in mind. Somebody should be
> able to approve an exception.

No I have seen people has added disabling thing as gray area.  (Old
network-manager,...)  Besides, these are two cooperating package by the
same maintainer and these are one of the cooperation script.  Perfectly
policy compliant!!! Also whatever happens, if im-switch is installed and
even if installation did not replace this script, it works :-)

> Using the attached file would also eliminate one of the current
> differences between the Debian and Ubuntu versions of im-config.
> Hopefully we'll soon be able to use exactly the same version.

Since if the md5sum are the same as installed, it is better to remove it
completely as they used to be.

So I modified a bit but in the same spirit :-)
I echo to STDERR.

Osamu

#!/bin/sh
# postinst script for im-config
# vim: set sts=4 expandtab:

set -e

# version just before wheezy release
# acb685ae9264be3fc1800f98a70b12bb  80im-switch 1.14
# 044a2f13aa8382902dc8f47dc7da7064  80im-switch 1.16 (oldstable) - 1.22 
(unstable)
# 5b34831bb3c203ced71b7efb6da4609e  80im-switch 1.23 (testing/unstable)

# 4045a8eeb0e9226cdd9f8a121ccf4c04  80im-config_launch 0.3 (stable initial)
# 8a4829f935b5561ca6e61bec6eb3893f  80im-config_launch 0.3+squeeze1 (stable), 
0.4
# b243876a16f7b87c397ceef626098069  80im-config_launch 0.5
# 5ef27261ac38d704d8f766da19635461  80im-config_launch 0.6-0.17 (testing, 
unstable)

case "$1" in
    configure)
        IM_SWITCH_HOOK=/etc/X11/Xsession.d/80im-switch
        IM_SWITCH_DISABLE_CODE='[ -x /usr/bin/im-switch ] || return 0'
        if [ -f $IM_SWITCH_HOOK ]; then
            IM_SWITCH_HOOK_MD5SUM=$(md5sum < $IM_SWITCH_HOOK|cut -d ' ' -f 1)
            case $IM_SWITCH_HOOK_MD5SUM in
                
acb685ae9264be3fc1800f98a70b12bb|044a2f13aa8382902dc8f47dc7da7064|5b34831bb3c203ced71b7efb6da4609e)
                    rm -f $IM_SWITCH_HOOK
                ;;
    
                *)
                    if [ "$( head -1 $IM_SWITCH_HOOK )" != 
"$IM_SWITCH_DISABLE_CODE" ];then
                        echo "Migrating from im-switch to im-config. Disabling: 
$IM_SWITCH_HOOK." >&2
                        sed -i "1 i $IM_SWITCH_DISABLE_CODE" $IM_SWITCH_HOOK
                    fi
                ;;
            esac
        fi

        IM_CONFIG_HOOK=/etc/X11/Xsession.d/80im-config_launch
        if [ -f $IM_CONFIG_HOOK ]; then
            IM_CONFIG_HOOK_MD5SUM=$(md5sum < $IM_CONFIG_HOOK|cut -d ' ' -f 1)
            case $IM_CONFIG_HOOK_MD5SUM in
                
4045a8eeb0e9226cdd9f8a121ccf4c04|8a4829f935b5561ca6e61bec6eb3893f|b243876a16f7b87c397ceef626098069|5ef27261ac38d704d8f766da19635461)
                    rm -f $IM_CONFIG_HOOK
                ;;
    
                *)
                    echo "ERROR: Unknown hook file exists: $IM_CONFIG_HOOK." >&2
                ;;
            esac
        fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

Reply via email to