#!/bin/sh
set -e

if [ "$1" = "failed-upgrade" ] ; then
    # there was a bug in dh-elpa,
    # this code won't be needed after Stretch released
    if dpkg --compare-versions "$2" lt 2.3.0-2; then
        echo "elpa-magit-popup: recovering from past breakage" >&2
        echo "may be leaving behind stuff in /usr/share/emacs24/site-lisp/elpa/" >&2
        exit 0
    fi
fi

# Automatically added by dh_elpa/UNDECLARED
if [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a -x /usr/lib/emacsen-common/emacs-package-remove ] ; then
	/usr/lib/emacsen-common/emacs-package-remove --prerm elpa-magit-popup
fi
# End automatically added section

