#! /bin/bash
#
# postinst script for the Debian package auctex
#
# Copyright (C) 1997-2017 Davide G. M. Salvetti.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
#
# On Debian GNU/Linux System you can find a copy of the GNU General Public
# License in "/usr/share/common-licenses/GPL".
set -e
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
for i in /usr/lib/emacs/common/auctex/auto/ /var/lib/emacs/auctex/; do
if [ -d ${i} ]; then
rm --recursive --force ${i}
fi
done
for i in /usr/lib/emacs/common/auctex /usr/lib/emacs/common; do
if [ -d ${i} ]; then
find ${i%/*} -name ${i##*/} -type d -empty \
| xargs --no-run-if-empty rmdir
fi
done
for f in 19 20 21; do
rm --force /usr/share/emacs${f}/site-lisp/preview/.nosearch
if [ -d /usr/share/emacs${f}/site-lisp/preview ]; then
rmdir --ignore-fail-on-non-empty \
/usr/share/emacs${f}/site-lisp/preview
fi
done
rm --force /var/log/auctex.log
rm --force /var/log/auctex-emacs.log
rm --force /usr/share/emacs/site-lisp/auctex/auto-loads.el~
for f in 21 22 23 -snapshot; do
dpkg-maintscript-helper rm_conffile \
/etc/emacs${f}/site-start.d/50auctex.el \
11.86-12~ auctex -- "${@}"
done
dpkg-maintscript-helper rm_conffile \
/etc/cron.weekly/auctex \
11.86-12~ auctex -- "${@}"
else
RUN_UPDATE_AUCTEX_ELISP=true
fi
source /usr/share/debconf/confmodule
db_version 2.0
db_get auctex/doauto || true
_db_doauto=${RET}
db_stop
# Automatically added by dh_installemacsen/11.5.3
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a -x /usr/lib/emacsen-common/emacs-package-install ] ; then
/usr/lib/emacsen-common/emacs-package-install --postinst auctex
fi
fi
# End automatically added section
case "${1}" in
(triggered)
RUN_UPDATE_AUCTEX_ELISP=true
for trigger in ${2}; do
case "${trigger}" in
(auctex-install-*)
FLAVORS="${FLAVORS}${FLAVORS:+ }${trigger#auctex-install-}"
;;
(/*)
FLAVORS="${FLAVORS}${FLAVORS:+ }"
;;
(*)
echo >&2 "${PROGNAME}:" \
"Unsupported trigger: ${trigger}"
exit 1
;;
esac
done
if fgrep '' <(echo ${FLAVORS}) &>/dev/null; then
unset FLAVORS;
fi
;;
esac
if [ -n "${RUN_UPDATE_AUCTEX_ELISP}" ]; then
case "${_db_doauto}" in
(Foreground)
update-auctex-elisp ${FLAVORS}
;;
(Background)
update-auctex-elisp --daemon ${FLAVORS}
;;
(None)
:
;;
(*)
echo >&2 "${PROGNAME}:" \
"Unsupported Debconf doauto value: ${_db_doauto}"
exit 1
;;
esac
fi
exit 0