summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2011-08-13 12:19:39 +0000
committerUlrich Müller <ulm@gentoo.org>2011-08-13 12:19:39 +0000
commit55cfd6f54d4a5a4cb32c803081752fcd88fc1c24 (patch)
tree986a653926989175e9b5bad3e5594af955db6104 /eclass
parentupdate to EAPI 4. (diff)
downloadgentoo-2-55cfd6f54d4a5a4cb32c803081752fcd88fc1c24.tar.gz
gentoo-2-55cfd6f54d4a5a4cb32c803081752fcd88fc1c24.tar.bz2
gentoo-2-55cfd6f54d4a5a4cb32c803081752fcd88fc1c24.zip
Sync elisp-common.eclass from Emacs overlay (revision 1670):
Error handling in function elisp-emacs-version.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/elisp-common.eclass12
1 files 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 <mkennedy@gentoo.org>
# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
@@ -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%%.*}."