From 7c91c0298cbd63c875932328c9daafa959bca74c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulrich=20M=C3=BCller?= Date: Sat, 13 Aug 2011 12:19:39 +0000 Subject: [PATCH] Sync elisp-common.eclass from Emacs overlay (revision 1670): Error handling in function elisp-emacs-version. --- eclass/elisp-common.eclass | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index b7b8a181ef1f..4c3bd8cf721f 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.71 2011/02/19 10:12:42 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.72 2011/08/13 12:19:39 ulm Exp $ # # Copyright 2002-2004 Matthew Kennedy # Copyright 2003 Jeremy Maitin-Shepard @@ -171,10 +171,16 @@ BYTECOMPFLAGS="-L ." # Output version of currently active Emacs. elisp-emacs-version() { + local ret # The following will work for at least versions 18-23. echo "(princ emacs-version)" >"${T}"/emacs-version.el ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el + ret=$? rm -f "${T}"/emacs-version.el + if [[ ${ret} -ne 0 ]]; then + eerror "elisp-emacs-version: Failed to run ${EMACS}" + fi + return ${ret} } # @FUNCTION: elisp-need-emacs @@ -185,8 +191,8 @@ elisp-emacs-version() { # specified as argument. elisp-need-emacs() { - local need_emacs=$1 - local have_emacs=$(elisp-emacs-version) + local need_emacs=$1 have_emacs + have_emacs=$(elisp-emacs-version) || return einfo "Emacs version: ${have_emacs}" if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then eerror "This package needs at least Emacs ${need_emacs%%.*}." -- 2.26.2