#!/bin/sh -e

if [ "$1" = "install" -o "$1" = "upgrade" ]; then
	# Move the old config files before dpkg checks them.
	if [ -d /etc/X11/xdg/xfce4 ]; then
		mkdir -p /etc/xdg/xfce4 || true
		mv /etc/X11/xdg/xfce4/* /etc/xdg/xfce4 || true
		rmdir /etc/X11/xdg/xfce4 || true
	fi

fi

if dpkg-maintscript-helper supports rm_conffile; then
  dpkg-maintscript-helper rm_conffile \
  /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
fi

# Remove symlinks for el which appeared in 4.8.2-1
case "$1" in
install|upgrade)
    if dpkg --compare-versions "$2" lt "4.8.2-1"; then
      [ -h /usr/share/doc/xfce4-utils/html/el/images ] && rm /usr/share/doc/xfce4-utils/html/el/images || true
    fi
esac

#DEBHELPER#

exit 0
