Package: openjdk-6-jre
Version: 6b24-1.11.5-1
Followup-For: Bug #685185

Hi,

I also noticed this problem in piuparts: over 300 packages report broken
alternatives after a squeeze->wheezy upgrade:
http://piuparts.debian.org/squeeze2wheezy/alternatives_after_purge_issue.html

Looking at the openjdk-6-jre preinst script which should somehow clean
this up, I see

1        for i in javaws pluginappletviewer; do
2            [ -x $old_basedir/jre/bin/$i ] || continue
3            dpkg-query -L openjdk-6-jre | grep -q ^$old_basedir/jre/bin/$i && 
continue
4            if [ -n "$(update-alternatives --list $i 2>/dev/null | grep 
^$old_basedir/)" ]; then
5                update-alternatives --remove $i $old_basedir/jre/bin/$i || true
6            fi
7        done

I don't see a reason for checking the existence of the old binary
(line 2) - this will also make proper cleanup more complicated.

Line 3 seems to be a logic error, as this always results in "continue"
(or an "exit 1" due to set -e), so lines 4-6 are never run.

update-alternatives gracefully (and silently) handles removal of
non-existing alternatives, so lines 4+6 could go as well.

Therefore I suggest to replace this block with

        # cleanup obsolete alternatives
        for i in javaws pluginappletviewer; do
            update-alternatives --remove $i $old_basedir/jre/bin/$i || true
        done

This will also cleanup broken alternatives that will be present on
systems that upgraded from squeeze to current wheezy.

Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to