summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2014-05-24 08:48:40 +0000
committerUlrich Müller <ulm@gentoo.org>2014-05-24 08:48:40 +0000
commit62e6c1f08d929f633206c5cd34a295fc8dd35315 (patch)
treebfd9de45904d3c4fb8a4036e755d7df9bd28f25e /eclass
parentDev channel bump. Include libpdf.so (pdfium). (diff)
downloadgentoo-2-62e6c1f08d929f633206c5cd34a295fc8dd35315.tar.gz
gentoo-2-62e6c1f08d929f633206c5cd34a295fc8dd35315.tar.bz2
gentoo-2-62e6c1f08d929f633206c5cd34a295fc8dd35315.zip
elisp-site-regen: Die on errors.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog4
-rw-r--r--eclass/elisp-common.eclass33
2 files changed, 18 insertions, 19 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 7a0f5f637ba4..e6dbd2257e9d 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,10 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1272 2014/05/24 08:47:29 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1273 2014/05/24 08:48:40 ulm Exp $
24 May 2014; Ulrich Müller <ulm@gentoo.org> elisp-common.eclass:
elisp-site-regen: Look for site-init files only in site-gentoo.d
- subdirectory.
+ subdirectory. Die on errors.
23 May 2014; Michał Górny <mgorny@gentoo.org> multilib-build.eclass:
Change ABI-flag separator from ":" to "." to avoid issues with Makefile rules
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index fd59584fd8fb..42ceb1276784 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.88 2014/05/24 08:47:29 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.89 2014/05/24 08:48:40 ulm Exp $
#
# @ECLASS: elisp-common.eclass
# @MAINTAINER:
@@ -345,31 +345,27 @@ elisp-site-file-install() {
elisp-site-regen() {
local sitelisp=${ROOT}${EPREFIX}${SITELISP}
- local sf i null="" page=$'\f'
+ local sf i ret=0 null="" page=$'\f'
local -a sflist
- if [[ ! -d ${sitelisp} ]]; then
- eerror "elisp-site-regen: Directory ${sitelisp} does not exist"
- return 1
- fi
-
- if [[ ! -d ${T} ]]; then
- eerror "elisp-site-regen: Temporary directory ${T} does not exist"
- return 1
- fi
-
if [[ ${EBUILD_PHASE} = *rm && ! -e ${sitelisp}/site-gentoo.el ]]; then
ewarn "Refusing to create site-gentoo.el in ${EBUILD_PHASE} phase."
return 0
fi
+ [[ -d ${sitelisp} ]] \
+ || die "elisp-site-regen: Directory ${sitelisp} does not exist"
+
+ [[ -d ${T} ]] \
+ || die "elisp-site-regen: Temporary directory ${T} does not exist"
+
ebegin "Regenerating site-gentoo.el for GNU Emacs (${EBUILD_PHASE})"
for sf in "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el; do
[[ -r ${sf} ]] && sflist+=("${sf}")
done
- cat <<-EOF >"${T}"/site-gentoo.el
+ cat <<-EOF >"${T}"/site-gentoo.el || ret=$?
;;; site-gentoo.el --- site initialisation for Gentoo-installed packages
;;; Commentary:
@@ -379,8 +375,8 @@ elisp-site-regen() {
;;; Code:
EOF
# Use sed instead of cat here, since files may miss a trailing newline.
- sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el
- cat <<-EOF >>"${T}"/site-gentoo.el
+ sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el || ret=$?
+ cat <<-EOF >>"${T}"/site-gentoo.el || ret=$?
${page}
(provide 'site-gentoo)
@@ -393,7 +389,10 @@ elisp-site-regen() {
;;; site-gentoo.el ends here
EOF
- if cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then
+ if [[ ${ret} -ne 0 ]]; then
+ eend ${ret} "elisp-site-regen: Writing site-gentoo.el failed."
+ die
+ elif cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then
# This prevents outputting unnecessary text when there
# was actually no change.
# A case is a remerge where we have doubled output.
@@ -402,7 +401,7 @@ elisp-site-regen() {
einfo "... no changes."
else
mv "${T}"/site-gentoo.el "${sitelisp}"/site-gentoo.el
- eend
+ eend $? "elisp-site-regen: Replacing site-gentoo.el failed" || die
case ${#sflist[@]} in
0) [[ ${PN} = emacs-common-gentoo ]] \
|| ewarn "... Huh? No site initialisation files found." ;;