Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: elisp-common.eclass ChangeLog
Date: Sat, 24 May 2014 08:48:43
Message-Id: 20140524084840.9395C2004E@flycatcher.gentoo.org
1 ulm 14/05/24 08:48:40
2
3 Modified: elisp-common.eclass ChangeLog
4 Log:
5 elisp-site-regen: Die on errors.
6
7 Revision Changes Path
8 1.89 eclass/elisp-common.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/elisp-common.eclass?rev=1.89&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/elisp-common.eclass?rev=1.89&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/elisp-common.eclass?r1=1.88&r2=1.89
13
14 Index: elisp-common.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v
17 retrieving revision 1.88
18 retrieving revision 1.89
19 diff -u -r1.88 -r1.89
20 --- elisp-common.eclass 24 May 2014 08:47:29 -0000 1.88
21 +++ elisp-common.eclass 24 May 2014 08:48:40 -0000 1.89
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2014 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.88 2014/05/24 08:47:29 ulm Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.89 2014/05/24 08:48:40 ulm Exp $
27 #
28 # @ECLASS: elisp-common.eclass
29 # @MAINTAINER:
30 @@ -345,31 +345,27 @@
31
32 elisp-site-regen() {
33 local sitelisp=${ROOT}${EPREFIX}${SITELISP}
34 - local sf i null="" page=$'\f'
35 + local sf i ret=0 null="" page=$'\f'
36 local -a sflist
37
38 - if [[ ! -d ${sitelisp} ]]; then
39 - eerror "elisp-site-regen: Directory ${sitelisp} does not exist"
40 - return 1
41 - fi
42 -
43 - if [[ ! -d ${T} ]]; then
44 - eerror "elisp-site-regen: Temporary directory ${T} does not exist"
45 - return 1
46 - fi
47 -
48 if [[ ${EBUILD_PHASE} = *rm && ! -e ${sitelisp}/site-gentoo.el ]]; then
49 ewarn "Refusing to create site-gentoo.el in ${EBUILD_PHASE} phase."
50 return 0
51 fi
52
53 + [[ -d ${sitelisp} ]] \
54 + || die "elisp-site-regen: Directory ${sitelisp} does not exist"
55 +
56 + [[ -d ${T} ]] \
57 + || die "elisp-site-regen: Temporary directory ${T} does not exist"
58 +
59 ebegin "Regenerating site-gentoo.el for GNU Emacs (${EBUILD_PHASE})"
60
61 for sf in "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el; do
62 [[ -r ${sf} ]] && sflist+=("${sf}")
63 done
64
65 - cat <<-EOF >"${T}"/site-gentoo.el
66 + cat <<-EOF >"${T}"/site-gentoo.el || ret=$?
67 ;;; site-gentoo.el --- site initialisation for Gentoo-installed packages
68
69 ;;; Commentary:
70 @@ -379,8 +375,8 @@
71 ;;; Code:
72 EOF
73 # Use sed instead of cat here, since files may miss a trailing newline.
74 - sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el
75 - cat <<-EOF >>"${T}"/site-gentoo.el
76 + sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el || ret=$?
77 + cat <<-EOF >>"${T}"/site-gentoo.el || ret=$?
78
79 ${page}
80 (provide 'site-gentoo)
81 @@ -393,7 +389,10 @@
82 ;;; site-gentoo.el ends here
83 EOF
84
85 - if cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then
86 + if [[ ${ret} -ne 0 ]]; then
87 + eend ${ret} "elisp-site-regen: Writing site-gentoo.el failed."
88 + die
89 + elif cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then
90 # This prevents outputting unnecessary text when there
91 # was actually no change.
92 # A case is a remerge where we have doubled output.
93 @@ -402,7 +401,7 @@
94 einfo "... no changes."
95 else
96 mv "${T}"/site-gentoo.el "${sitelisp}"/site-gentoo.el
97 - eend
98 + eend $? "elisp-site-regen: Replacing site-gentoo.el failed" || die
99 case ${#sflist[@]} in
100 0) [[ ${PN} = emacs-common-gentoo ]] \
101 || ewarn "... Huh? No site initialisation files found." ;;
102
103
104
105 1.1273 eclass/ChangeLog
106
107 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1273&view=markup
108 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1273&content-type=text/plain
109 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1272&r2=1.1273
110
111 Index: ChangeLog
112 ===================================================================
113 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
114 retrieving revision 1.1272
115 retrieving revision 1.1273
116 diff -u -r1.1272 -r1.1273
117 --- ChangeLog 24 May 2014 08:47:29 -0000 1.1272
118 +++ ChangeLog 24 May 2014 08:48:40 -0000 1.1273
119 @@ -1,10 +1,10 @@
120 # ChangeLog for eclass directory
121 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
122 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1272 2014/05/24 08:47:29 ulm Exp $
123 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1273 2014/05/24 08:48:40 ulm Exp $
124
125 24 May 2014; Ulrich Müller <ulm@g.o> elisp-common.eclass:
126 elisp-site-regen: Look for site-init files only in site-gentoo.d
127 - subdirectory.
128 + subdirectory. Die on errors.
129
130 23 May 2014; Michał Górny <mgorny@g.o> multilib-build.eclass:
131 Change ABI-flag separator from ":" to "." to avoid issues with Makefile rules