#! /bin/bash
#
# postinst script for the Debian package auctex
#
# Copyright (C) 1997-2023 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 [ -n "${DEBCONF_RECONFIGURE}" ]; then
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/13.11.8
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