#! /bin/sh
set -e

#DEBHELPER#

if [ "$1" = remove ] || [ "$1" = deconfigure ] || [ "$1" = failed-upgrade ]; then
    if [ -x /usr/sbin/update-alternatives ]; then
        # remove alternatives for qemu-system binaries
        arches="arm cris m68k microblaze mips mips64 mips64el mipsel ppc ppc64 ppcemb s390x sh4 sh4eb sparc sparc64 x86_64 i386"
        for arch in $arches ; do
            update-alternatives --remove qemu /usr/bin/qemu-system-"$arch"
        done
    fi
fi
