#!/bin/sh

set -e

case "$1" in
  upgrade)
    if dpkg --compare-versions "$2" lt "2.13.16-1" && dpkg --compare-versions "$2" ge "2.10.2-1"; then
      # This file is common between unison and unison-gtk package
      if @IS_GTK@; then
        echo "Deleting alternatives to unison2.10.2-gtk"
        update-alternatives --remove unison-gtk /usr/bin/unison2.10.2-gtk
      else
        echo "Deleting alternatives to unison2.10.2"
        update-alternatives --remove unison /usr/bin/unison2.10.2
      fi
    fi
  ;;
esac

#DEBHELPER#
