summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2021-04-13 09:23:35 +0200
committerUlrich Müller <ulm@gentoo.org>2021-04-19 22:08:15 +0200
commitcd54946e602964006be18c473ae204d77733e891 (patch)
treea781252a354736992eef232a4015e875c84f2332 /eclass
parentpackage.mask: Last rite x11-apps/amlc (diff)
downloadgentoo-cd54946e602964006be18c473ae204d77733e891.tar.gz
gentoo-cd54946e602964006be18c473ae204d77733e891.tar.bz2
gentoo-cd54946e602964006be18c473ae204d77733e891.zip
elisp-common.eclass: Add timeout to version detection
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/elisp-common.eclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 832fc19e4675..bdf97f413033 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -219,7 +219,9 @@ _ELISP_EMACS_VERSION=""
# Output version of currently active Emacs.
elisp-emacs-version() {
- local version ret
+ local version ret tmout="timeout -k 5 55"
+ # Run without timeout if the command is not available
+ ${tmout} true &>/dev/null || tmout=""
# The following will work for at least versions 18-24.
echo "(princ emacs-version)" >"${T}"/emacs-version.el
version=$(
@@ -228,7 +230,7 @@ elisp-emacs-version() {
# Redirecting stdin and unsetting TERM and DISPLAY will cause
# most of them to exit with an error.
unset TERM DISPLAY
- ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el </dev/null
+ ${tmout} ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el </dev/null
)
ret=$?
rm -f "${T}"/emacs-version.el