#!/bin/bash

# remove diversions from non-config files
if [ remove = "$1" -o abort-install = "$1" -o disappear = "$1" ] || \
   ([ abort-upgrade = "$1" ] && dpkg --compare-versions "$2" lt 0.6); then
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/backgrounds/warty-final-ubuntu.png
fi

if [ remove = "$1" -o abort-install = "$1" -o disappear = "$1" ] || \
   ([ abort-upgrade = "$1" ] && dpkg --compare-versions "$2" lt 9); then
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/applications/openoffice.org-writer.desktop
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/applications/openoffice.org-math.desktop
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/applications/openoffice.org-impress.desktop
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/applications/openoffice.org-draw.desktop
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/applications/openoffice.org-calc.desktop
  dpkg-divert --package ubuntu-samos-config --rename --remove /usr/share/applications/openoffice.org-base.desktop
fi

#DEBHELPER#

