Needs to keep hands off when removed but not purged

Bug #1101836 reported by Aron Xu
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
im-config (Debian)
Fix Released
Unknown
im-config (Ubuntu)
Fix Released
Medium
Gunnar Hjalmarsson
Precise
Invalid
Undecided
Unassigned
Quantal
Invalid
Undecided
Unassigned
Raring
Fix Released
Medium
Gunnar Hjalmarsson
im-switch (Debian)
Fix Released
Unknown
im-switch (Ubuntu)
Fix Released
Low
Gunnar Hjalmarsson
Precise
Fix Released
Undecided
Unassigned
Quantal
Fix Released
Undecided
Unassigned
Raring
Fix Released
Low
Gunnar Hjalmarsson

Bug Description

Nomination of im-switch for Precise and Quantal SRUs
====================================================

[Impact]
In raring, we are replacing im-switch with im-config, but when im-switch isn't purged but only removed, scripts in /etc/X11/Xsession.d/ will still try to set related variables, so that im-config cannot work correctly.

[Test Case]
Steps to reproduce:
* Make sure you have an updated Precise or Quantal.
* Select "ibus" from Language Support.
* Remove im-switch without purging.
* Log out and log in again.
* Run "env | grep IM" from a terminal window and find that im related
  environment variables were set when they shouldn't.

[Regression Potential]
None.

Remaining from original description
===================================

Fixing im-switch in Precise and Quantal is part of the solution to this problem, something else must be done for those who haven't got the chance to upgrade to the fixed version.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Hi Aron,

The file that needs to be removed is 80im-switch, isn't it? debian/postinst in the im-config package contains code that normally removes 80im-switch.

However, it's only removed if its md5sum matches one of the md5sums listed in debian/postinst. In https://launchpad.net/ubuntu/+source/im-config/0.19ubuntu1 I added the md5sum for the modified file that the solution to bug 875435 resulted in.

So as far as I know, this should work. The case when 80im-switch is not removed is if you have made your own modifications to the file. Could that possibly be the reason why you have encountered a problem?

Changed in im-switch (Ubuntu):
status: New → Incomplete
Revision history for this message
Aron Xu (happyaron) wrote :

It wasn't mine, I purge im-switch before installing im-config - actually I've been using im-config on Ubuntu for more than a year. It was reported by a user to me, and after examining his /etc/X11 configurations I found this was the cause. We need to have a solution for those files that aren't automatically removed since they behave badly when both packages are present.

Revision history for this message
osamu (osamu) wrote : Re: [Bug 1101836] Re: Needs to keep hands off when removed but not purged

Hi,

On Tue, Jan 22, 2013 at 07:27:09AM -0000, Aron Xu wrote:
> It wasn't mine, I purge im-switch before installing im-config - actually
> I've been using im-config on Ubuntu for more than a year. It was
> reported by a user to me, and after examining his /etc/X11
> configurations I found this was the cause. We need to have a solution
> for those files that aren't automatically removed since they behave
> badly when both packages are present.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1101836
>
> Title:
> Needs to keep hands off when removed but not purged

Aron, can you forward this bug to upstream properly by reporting with
full context.

I think we need to deal with this issue on Debian too.

Basically, I think these hook script should be deactivated if there is
no package installed. Let's think... policy complient solution.

Osamu

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Well Aron, my belief is that we have such a solution through the debian/postinst file in im-config. To know if there is a remaining issue that needs to be addressed - and how to address it - we need to know the exact nature of that issue.

* I think that 80im-switch is the only file that has to be removed, and
  that the other left-over im-switch files do not matter. Was the
  problem the user in question encountered caused by some other file(s)
  but 80im-switch?

* I think that all officially released versions of 80im-switch are
  automatically removed by debian/postinst in im-config. Was there a
  non-modified copy of 80im-switch left on the user's system?

Considering the problem described in bug 875435, unfortunately it's not unlikely that there are quite a few modified copies of 80im-switch out there. It should be noted that Osamu had to defend the code in debian/postinst in relation to Debian policies with respect to configuration files: http://bugs.debian.org/690212

It could be argued that /etc/X11/Xsession.d/80im-switch is not really a config file, and consequently that config file policies don't apply. Personally I think that's a reasonable standpoint in this case, and if so it could be motivated to drop the md5sum check. However, I suppose that such a change should not be Ubuntu specific, since 80im-switch is just as harmful on Debian after a transition to im-config.

Osamu, would it be possible to drop the md5sum check in debian/postinst?

@Sebastien: Subscribed you to this bug, since we had a similar discussion when you sponsored
https://launchpad.net/ubuntu/+source/im-config/0.19ubuntu1

Revision history for this message
Aron Xu (happyaron) wrote :

On Tue, Jan 22, 2013 at 9:30 PM, Osamu Aoki <email address hidden> wrote:
> Hi,
>
> On Tue, Jan 22, 2013 at 07:27:09AM -0000, Aron Xu wrote:
>> It wasn't mine, I purge im-switch before installing im-config - actually
>> I've been using im-config on Ubuntu for more than a year. It was
>> reported by a user to me, and after examining his /etc/X11
>> configurations I found this was the cause. We need to have a solution
>> for those files that aren't automatically removed since they behave
>> badly when both packages are present.
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1101836
>>
>> Title:
>> Needs to keep hands off when removed but not purged
>
> Aron, can you forward this bug to upstream properly by reporting with
> full context.
>
> I think we need to deal with this issue on Debian too.
>
> Basically, I think these hook script should be deactivated if there is
> no package installed. Let's think... policy complient solution.
>

I haven't examine the user's configurations in more details, it's the
reason why I haven't reported to you. I'll look into it ASAP and send
it to Debian BTS.

--
Regards,
Aron Xu

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2013-01-22 14:30, osamu wrote:
> Basically, I think these hook script should be deactivated if there is
> no package installed.

It would be nice to have at the top of 80im-switch something like:

  test -x /usr/bin/im-switch || exit 0

But how would we get it there? Or, when saying "should be deactivated", do you have something else in mind?

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Hi Osamu and Aron!

If there proves to be an important issue here, we'd better resolve it before the release of Ubuntu 13.04 in April. Consequently I kindly ask you to help evaluate the possible impact of this bug ASAP.

Rgds,
Gunnar

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

In light of an IRC discussion earlier today, I prepared a merge proposal that might be what we want.

Changed in im-switch (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
status: Incomplete → In Progress
affects: im-switch (Ubuntu) → im-config (Ubuntu)
Martin Pitt (pitti)
Changed in im-config (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package im-config - 0.19ubuntu3

---------------
im-config (0.19ubuntu3) raring; urgency=low

  * debian/postinst:
    For cases when 80im-switch is not removed because it was modified
    by the user, we prepend a line that in effect disables it
    (LP: #1101836).
 -- Gunnar Hjalmarsson <email address hidden> Thu, 21 Feb 2013 15:23:20 +0100

Changed in im-config (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Iain Lane (laney) wrote on the merge proposal page:
> I was kind of hoping you'd get rid of the deletion completely and
> just insert the line to disable if necessary when you detect it
> wasn't there. Couldn't we do that instead?
>
> The deletion is bad because it makes dpkg think that the user
> performed this action when actually he didn't. dpkg then won't
> reinstall this file for you.
>
> We should also be updating im-switch to insert this line in the
> normal way - this postinst change is only supposed to be a failsafe.

Hi Laney,

Personally I wouldn't mind to drop the md5sum check/deletion part. One reason I didn't (so far) was out of respect for possible Debian and Ubuntu policies. But that's probably faulty logic - I guess that adding the disable line doesn't violate any policies more than deleting a file in another package. Maybe less.

I'm also disinclined to differ from the Debian version more than necessary, so I'd prefer a consensus before proposing that change. Hopefully we'll end up with an im-config package that is identical with the Debian one - it's a 3.0 (native) package. On that topic version 0.20 has been released at Debian.

A while ago Osamu mentioned an idea to apply patches conditionally...

As regards updating im-switch... Added an im-switch task as a reminder. OTOH, I know that Aron and Osamu consider im-switch to be 'dead' and a candidate for archive removal. In the light of that, is it really worth it to spend time with SRUing that change?

Osamu and Aron, what do you think?

Revision history for this message
Iain Lane (laney) wrote :

Hey Gunnar,

On Fri, Feb 22, 2013 at 02:47:23AM -0000, Gunnar Hjalmarsson wrote:
> […]
> Personally I wouldn't mind to drop the md5sum check/deletion part. One
> reason I didn't (so far) was out of respect for possible Debian and
> Ubuntu policies. But that's probably faulty logic - I guess that adding
> the disable line doesn't violate any policies more than deleting a file
> in another package. Maybe less.
>
> I'm also disinclined to differ from the Debian version more than
> necessary, so I'd prefer a consensus before proposing that change.
> Hopefully we'll end up with an im-config package that is identical with
> the Debian one - it's a 3.0 (native) package. On that topic version 0.20
> has been released at Debian.

Yes - all of these problems exist on Debian too, although they way they
might be addressed there could be different I suppose. The basic issues
are the same though.

>
> A while ago Osamu mentioned an idea to apply patches conditionally...
>
> As regards updating im-switch... Added an im-switch task as a reminder.
> OTOH, I know that Aron and Osamu consider im-switch to be 'dead' and a
> candidate for archive removal. In the light of that, is it really worth
> it to spend time with SRUing that change?

I think so - it should just be a simple change to the config file (and
my offer to sponsor still stands), so not a very difficult change to
SRU. It may be dead (and should therefore be removed from Raring after
switching Kubuntu over), but we do have it in stable releases still. IMO
the fix to im-config should be considered as a fallback if the user
didn't fully update before moving to raring.

Cheers,

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
osamu (osamu) wrote :

On Fri, Feb 22, 2013 at 02:47:23AM -0000, Gunnar Hjalmarsson wrote:
> A while ago Osamu mentioned an idea to apply patches conditionally...

I have uploaded new version to Debian unstable. Please test it on
ubuntu too. If I hear no issue over weekend, I will ask release
exception.

> As regards updating im-switch... Added an im-switch task as a reminder.
> OTOH, I know that Aron and Osamu consider im-switch to be 'dead' and a
> candidate for archive removal. In the light of that, is it really worth
> it to spend time with SRUing that change?

Yah, people are expected to upload to latest stable before migrating
next. Why not. But maybe overkill...

It only hits user if they changed conffile. If they did, this version
may not be instal conffile overwriting user modified one anyway. That
is why im-config putting return 0 into im-switch maybe better solution.
(But that is violating ...)

Osamu

Changed in im-switch (Debian):
status: Unknown → Fix Released
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

In the linked im-config merge proposal I have merged Debian's version 0.20 and changed debian/postinst in accordance with Laney's suggestion. The im-switch MP's are ready to be sponsored.

Changed in im-config (Ubuntu):
importance: Undecided → Medium
status: Fix Released → In Progress
Changed in im-switch (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → Low
status: New → In Progress
Changed in im-config (Debian):
status: Unknown → New
Revision history for this message
Iain Lane (laney) wrote :

All im-switches uploaded. I'll look at im-config right now.

Can you please update the bug description of this bug to add the SRU information? Description, test case, regression potential

  https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Changed in im-config (Ubuntu Precise):
status: New → Invalid
Changed in im-config (Ubuntu Quantal):
status: New → Invalid
Changed in im-switch (Ubuntu Precise):
status: New → In Progress
Changed in im-switch (Ubuntu Quantal):
status: New → In Progress
Revision history for this message
Iain Lane (laney) wrote :

Thanks - Looks alright to me except that the removal is still there. Can I delete it? Seems unnecessary now that we've made 80im-switch properly robust?

Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello Aron, or anyone else affected,

Accepted im-switch into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/im-switch/1.20ubuntu5.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in im-switch (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in im-switch (Ubuntu Quantal):
status: In Progress → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

Hello Aron, or anyone else affected,

Accepted im-switch into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/im-switch/1.22ubuntu2.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Laney,

SRU info added to description.

Well, when you looked at the im-config MP yesterday, no code for removing 80im-switch was there actually. (Code for removing 80im-config_launch was there, though.)

Today is another thing. ;-) Since I try to minimize the differences to Debian, I now propose that the 0.21 version of debian/postinst is merged. Even if that file does contain code for removing 80im-switch, the latter won't be removed here since the md5sum for 80im-switch on Ubuntu is not listed. So, with the extra condition I added in revision 26 in my branch, it should be ok, and everyone should be happy. :)

description: updated
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I have successfully installed and run both the 1.20ubuntu5.2 (Precise) version and the 1.22ubuntu2.2 (Quantal) version of im-switch. Following the test case steps above does no longer result in any im related environment variables being set.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package im-config - 0.20ubuntu1

---------------
im-config (0.20ubuntu1) raring; urgency=low

  * debian/patches/02_list_installed_input_methods.patch:
    Refreshed.
  * debian/postinst:
    Prepend a disable line to 80im-switch if not there already,
    whether the file has been modified by the user or not
    (LP: #1101836). This does not break the dpkg logic, and is a
    cleaner method to safely prevent adverse impact considering that
    the im-switch package has been updated to include such a line.
  * debian/rules:
    Use quilt in Ubuntu only. This change should make it possible to
    use exactly the same version of this package in Debian and Ubuntu.
  * Merged from Debian unstable, remaining changes:
    - debian/control: Build-Depends on quilt.
    - debian/rules: Use quilt when building on Ubuntu.
    - debian/postinst: Add disable line to 80im-switch instead of
      deleting the file. (Proposed that Debian does the same:
      http://bugs.debian.org/701224)
    - debian/patches/01_make_cjkv_mode_default.patch
    - debian/patches/02_list_installed_input_methods.patch
    - debian/patches/series
 -- Gunnar Hjalmarsson <email address hidden> Tue, 26 Feb 2013 17:19:01 +0000

Changed in im-config (Ubuntu Raring):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package im-switch - 1.22ubuntu6

---------------
im-switch (1.22ubuntu6) raring; urgency=low

  * 80im-switch:
    - A line added to prevent that 80im-switch is sourced if the
      package has been removed but not purged (LP: #1101836).
 -- Gunnar Hjalmarsson <email address hidden> Sat, 23 Feb 2013 04:27:00 +0100

Changed in im-switch (Ubuntu Raring):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package im-switch - 1.22ubuntu2.2

---------------
im-switch (1.22ubuntu2.2) quantal-proposed; urgency=low

  * 80im-switch:
    - A line added to prevent that 80im-switch is sourced if the
      package has been removed but not purged (LP: #1101836).
 -- Gunnar Hjalmarsson <email address hidden> Sat, 23 Feb 2013 04:28:00 +0100

Changed in im-switch (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package im-switch - 1.20ubuntu5.2

---------------
im-switch (1.20ubuntu5.2) precise-proposed; urgency=low

  * 80im-switch:
    - A line added to prevent that 80im-switch is sourced if the
      package has been removed but not purged (LP: #1101836).
 -- Gunnar Hjalmarsson <email address hidden> Sat, 23 Feb 2013 04:29:00 +0100

Changed in im-switch (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in im-config (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.