File update-alternatives-669716.script of Package update-alternatives

#!/bin/sh

# The fix for https://bugzilla.novell.com/show_bug.cgi?id=669716
#
# The change needed for update-alternatives update
# https://bugzilla.novell.com/show_bug.cgi?id=648260 broke the
# /var/lib/rpm/alternatives/java for Sun Java under some circumstances

ALT=/var/lib/rpm/alternatives/java

if [ -f $ALT ]; then
    TEMPFILE=`/bin/mktemp java.alternatives.XXXXXXX`
    /bin/cp $ALT $TEMPFILE
    /usr/bin/sed '/.*sun.*/,/^$/ {/^$/d}' $TEMPFILE | sed '/.*sun.*/,/^$/ {/^$/d}; $a

'  > $ALT
    /bin/rm $TEMPFILE
fi
openSUSE Build Service is sponsored by