diff options
author | 2021-04-12 21:01:01 +0200 | |
---|---|---|
committer | 2021-04-12 21:01:01 +0200 | |
commit | ed7745256875f460578f0ecd8adbf9724cede1ae (patch) | |
tree | 6b83f5d6105ee0622d31c94504ff47103ae078b2 /eclass | |
parent | app-xemacs/ebuild-mode: Initial import (diff) | |
download | emacs-ed7745256875f460578f0ecd8adbf9724cede1ae.tar.gz emacs-ed7745256875f460578f0ecd8adbf9724cede1ae.tar.bz2 emacs-ed7745256875f460578f0ecd8adbf9724cede1ae.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.eclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 832fc19..bdf97f4 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 |