#!/bin/sh set -e # Pre-emptively upgrade emacsen-common remove script to deal with several # possible issues when upgrading from version 0.8.12-4 or older. These can # cause the emacsen-common remove script to exit non-zero, breaking the package # upgrade if [ "$1" = "failed-upgrade" ] && dpkg --compare-versions "$2" lt 0.8.12-5; then broken_remove_script="/usr/lib/emacsen-common/packages/remove/elpa-company" # (1) exit cleanly for xemacs21 -- without this, the call to find(1) can # exit non-zero sed --quiet -i "$broken_remove_script" \ -e '/Skipping unsupported emacs ${FLAVOUR}/a \ exit 0' # (2) exit cleanly for yet older unsupported Emacsen that might be installed sed --quiet -i "$broken_remove_script" \ -e 's/emacs23)/emacs2[0123]*)/' 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-company fi # End automatically added section