/usr/sbin/update-auctex-elisp is in auctex 11.91-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135  | #! /bin/bash
#
# update-auctex-elisp - Update AUCTeX auto-loads
# [installed by the Debian auctex package]
#
# 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 <http://www.gnu.org/licenses/>.
#
# On Debian GNU/Linux System you can find a copy of the GNU General Public
# License in "/usr/share/common-licenses/GPL".
set -e
PROGNAME=$(basename ${0})
GETOPT=$(getopt -o '' --long 'daemon,no-act' -- "${@}")
if [ ${?} != 0 ]; then
    echo >&2 "${PROGNAME}:" 'getopt error'
    exit 1
fi
eval set -- "${GETOPT}"
unset GETOPT
while true; do
    case "$1" in
	(--daemon)
	    DAEMON_MODE='true'
	    shift
	    ;;
	(--no-act)
	    NO_ACT='true'
	    shift
	    ;;
	(--)
	    shift
	    break
	    ;;
	(*)
	    echo >&2 "${PROGNAME}:" \
		"Internal error: unhandled option: $1"
	    exit 1;;
    esac
done
FLAVORS=${*:-'emacs24 emacs25 emacs-snapshot'}
LOGMASK='/var/lib/auctex/%s/CompilationLog'
if [ -n "${_UPDATE_AUCTEX_ELISP_DAEMON_MODE}" ]; then
    _FLAVORS=${FLAVORS}
else
    for FLAVOR in ${FLAVORS}; do
	if ! egrep '^emacs' <(echo ${FLAVOR}) &>/dev/null; then
	    echo "${PROGNAME}:" \
		'Ignoring what does not look like an Emacs flavor:' \
		"${FLAVOR}"
	    continue
	fi
	if [ ! -x /usr/bin/${FLAVOR} ]; then
	    echo "${PROGNAME}:" \
		"Ignoring uninstalled Emacs flavor: ${FLAVOR}"
	    continue
	fi
	_FLAVORS="${_FLAVORS}${_FLAVORS:+ }${FLAVOR}"
    done
    if [ -n "${DAEMON_MODE}" -a "${DAEMON_MODE}" = 'true' ]; then
	export _UPDATE_AUCTEX_ELISP_DAEMON_MODE=${DAEMON_MODE}
	cd / && nohup ${0} ${_FLAVORS} </dev/null &>/dev/null &
	PID=${!}
	for FLAVOR in ${_FLAVORS}; do
	    echo "${PROGNAME}[${PID}]:" \
		"Will scan macros for Emacs flavor ${FLAVOR}" \
		"(log to $(printf ${LOGMASK} ${FLAVOR}))"
	done
	exit 0
    fi
fi
PIDFILE=/var/run/${PROGNAME}.pid
trap 'echo ${TMPFILE} | xargs --no-run-if-empty rm --force' EXIT
TMPFILE=$(mktemp /var/run/${PROGNAME}.XXXXXXXX)
chmod a+r ${TMPFILE}
echo ${$} > ${TMPFILE}
until ln ${TMPFILE} ${PIDFILE} &>/dev/null; do
    kill -0 $(cat ${PIDFILE}) &>/dev/null || rm --force ${PIDFILE}
    sleep 1
done
rm --force ${TMPFILE}
trap 'rm --force ${PIDFILE}' EXIT
for FLAVOR in ${_FLAVORS}; do
    ${NO_ACT:+'echo'} rm --force --recursive /var/lib/auctex/${FLAVOR}
    ${NO_ACT:+'echo'} install --owner root --group root --mode 755 \
	--directory /var/lib/auctex/${FLAVOR}
    LOGFILE=/var/lib/auctex/${FLAVOR}/CompilationLog
    echo -n "${PROGNAME}:" \
	"Scanning macros for Emacs flavor ${FLAVOR}" \
	"(log to ${LOGFILE})..."
    [ -z "${NO_ACT}" -o "${NO_ACT}" != 'true' ] && \
	exec {stdout}>&1 {stderr}>&2 &>${LOGFILE}
    EXIT_STATUS=0
    ${NO_ACT:+'echo'} ${FLAVOR} --batch --no-site-file --no-init-file \
	--load=/usr/share/emacs/site-lisp/tex-site.el \
	--funcall=TeX-auto-generate-global \
	|| EXIT_STATUS=$?
    [ -z "${NO_ACT}" -o "${NO_ACT}" != 'true' ] && \
	exec 1>&${stdout} 2>&${stderr}
    if [ ${EXIT_STATUS} -gt 0 ]; then
	echo -e ' failed.\n<LOGFILE>'
	${NO_ACT:+'echo'} cat ${LOGFILE}
	echo '</LOGFILE>'
	exit ${EXIT_STATUS}
    else
	echo ' done.'
    fi
    ${NO_ACT:+'echo'} gzip --best --force ${LOGFILE}
done
if [ -z "${NO_ACT}" -o "${NO_ACT}" != 'true' ]; then
    find /var/lib/auctex -type f -name \*.el -print0 \
	| xargs --null --no-run-if-empty rm --force
fi
exit 0
 |