public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Mueller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs:master commit in: eclass/
Date: Thu, 18 Jul 2013 20:36:33 +0000 (UTC)	[thread overview]
Message-ID: <1374179854.0914a69ece4ac510cacd7719a6d7a11de3a8a071.ulm@gentoo> (raw)

commit:     0914a69ece4ac510cacd7719a6d7a11de3a8a071
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 18 20:37:34 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Jul 18 20:37:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs.git;a=commit;h=0914a69e

Make elisp-emacs-version() more robust.

---
 eclass/elisp-common.eclass | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index dcba57b..8f6a826 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -173,16 +173,27 @@ BYTECOMPFLAGS="-L ."
 # Output version of currently active Emacs.
 
 elisp-emacs-version() {
-	local ret
+	local version ret
 	# The following will work for at least versions 18-24.
 	echo "(princ emacs-version)" >"${T}"/emacs-version.el
-	${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el
+	version=$(
+		# EMACS could be a microemacs variant that doesn't know our
+		# options and would hang in interactive mode. Redirecting stdin
+		# and unsetting TERM and DISPLAY will make most of them fail.
+		unset TERM DISPLAY
+		${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el </dev/null
+	)
 	ret=$?
 	rm -f "${T}"/emacs-version.el
 	if [[ ${ret} -ne 0 ]]; then
 		eerror "elisp-emacs-version: Failed to run ${EMACS}"
+		return ${ret}
+	fi
+	if [[ -z ${version} ]]; then
+		eerror "elisp-emacs-version: Could not determine Emacs version"
+		return 1
 	fi
-	return ${ret}
+	echo "${version}"
 }
 
 # @FUNCTION: elisp-need-emacs


             reply	other threads:[~2013-07-18 20:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 20:36 Ulrich Mueller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-31  8:34 [gentoo-commits] proj/emacs:master commit in: eclass/ Ulrich Müller
2015-12-20 15:36 Ulrich Müller
2015-05-25 13:19 Ulrich Müller
2015-05-25 13:19 Ulrich Müller
2015-05-25 13:19 Ulrich Müller
2014-06-11  9:15 Ulrich Müller
2014-06-07 10:32 Ulrich Müller
2014-05-19 17:38 Ulrich Müller
2014-05-18 14:53 Ulrich Müller
2014-05-18 14:53 Ulrich Müller
2013-11-04 21:34 Ulrich Müller
2013-10-31 15:07 Ulrich Müller
2013-09-04 19:12 Ulrich Mueller
2013-08-02 16:46 Ulrich Mueller
2013-07-22 20:07 Ulrich Mueller
2013-07-16 16:37 Mats Lidell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374179854.0914a69ece4ac510cacd7719a6d7a11de3a8a071.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox