Ignore error of "update-alternatives --remove" in postrm

Bug #194101 reported by Daniel Hahler
6
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Won't Fix
Undecided
Unassigned
kubuntu-default-settings (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: kubuntu-default-settings

In ubuntu-default-settings.postrm the following gets done:
case "$1" in
  remove|deconfigure|failed-upgrade)
    echo Unsetting kubuntu as default mouse cursor theme ...
    update-alternatives --remove x-cursor-theme \
        /usr/share/icons/kubuntu/index.theme
  ;;

This caused problems on my system, after I've forcefully moved /usr/X11R6/lib away (as it seemed obsolete), but /var/lib/dpkg/alternatives/x-cursor-theme has the following content:
-------------
auto
/usr/X11R6/lib/X11/icons/default/index.theme

/usr/share/icons/DMZ-White/cursor.theme
50
/usr/share/icons/DMZ-Black/cursor.theme
30
-------------

Because of this, update-alternative failed:
update-alternatives: unable to make /usr/X11R6/lib/X11/icons/default/index.theme.dpkg-tmp a symlink to /etc/alternatives/x-cursor-theme: No such file or directory

But this is not a problem of/for kubuntu-default-settings and therefore the error should get ignored.

I'll provide a patch to fix this.

Daniel Hahler (blueyed)
Changed in kubuntu-default-settings:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Daniel Hahler (blueyed) wrote :

There appears to be another bug somewhere though, which caused /usr/X11R6/lib/X11/icons/default/index.theme to stay there (though obsolete?).

If I remember correctly, I've noticed that it is "obsolete", after purging kubuntu-default-settings (or another package) and dpkg told me that it does not delete the directories, because they are not empty.

Revision history for this message
Daniel Hahler (blueyed) wrote :

I've created a bug task for dpkg, too, because I think it should handle the situation better.
For the record, it fails in the following last block of the last "$mode eq 'auto'" code:
            checked_alternative($sname, $slink, $spath);
            checked_symlink("$spath", "$altdir/$sname.dpkg-tmp");
            checked_mv("$altdir/$sname.dpkg-tmp", "$altdir/$sname");

Revision history for this message
Daniel Hahler (blueyed) wrote :

Updated the changelog, so that it refers to bug 65021, which this patch fixes, too. (I've just found that bug being reported already)

Revision history for this message
Daniel Hahler (blueyed) wrote :

Should I create/publish a branch for this to get this integrated?

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

This bug was fixed in the package kubuntu-default-settings - 1:8.04-13

---------------
kubuntu-default-settings (1:8.04-13) hardy; urgency=low

  [ Jonathan Riddell ]
  * Set style to qtcurve in kde-rc-files/kdeglobals

  [ Daniel Hahler ]
  * debian/kubuntu-default-settings.postrm:
    - Do not bail out if "update-alternatives --remove" fails (LP: #194101)
    - Add no-op case for "upgrade" action and mention unknown action in
      catch-all case (LP: #65021)
  * German translation for konqueror-profile/email.desktop

 -- Anthony Mercatante <email address hidden> Tue, 11 Mar 2008 18:29:03 +0100

Changed in kubuntu-default-settings:
status: Triaged → Fix Released
Revision history for this message
Daniel Holbach (dholbach) wrote :

Unsubscribing ums until there's a patch for dpkg.

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

update-alternatives rightfully fails if the directory where the alternative must be installed doesn't exist. I don't see any improvement idea here. Besides update-alternatives has been rewritten and made more sensible in many situations since the time this bug has been reported.

Changed in dpkg (Ubuntu):
status: New → Won't Fix
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.