public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Mueller (ulm)" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: elisp-common.eclass
Date: Fri, 07 Mar 2008 08:19:19 +0000	[thread overview]
Message-ID: <E1JXXnT-00011e-MU@stork.gentoo.org> (raw)

ulm         08/03/07 08:19:19

  Modified:             elisp-common.eclass
  Log:
  Sync eclasses from Emacs overlay (revision 1012).
  
  elisp-common.eclass:
  Work around Paludis borkage, where variable T is empty in pkg_postrm.
  Clean up temporary files.

Revision  Changes    Path
1.37                 eclass/elisp-common.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?rev=1.37&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?rev=1.37&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?r1=1.36&r2=1.37

Index: elisp-common.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- elisp-common.eclass	22 Feb 2008 09:30:40 -0000	1.36
+++ elisp-common.eclass	7 Mar 2008 08:19:19 -0000	1.37
@@ -1,6 +1,6 @@
 # Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.36 2008/02/22 09:30:40 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.37 2008/03/07 08:19:19 ulm Exp $
 #
 # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
 # Copyright 2003      Jeremy Maitin-Shepard <jbms@attbi.com>
@@ -203,6 +203,7 @@
 	# 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
+	rm -f "${T}"/emacs-version.el
 }
 
 # @FUNCTION: elisp-make-autoload-file
@@ -262,16 +263,18 @@
 # Install Emacs site-init file in SITELISP directory.
 
 elisp-site-file-install() {
-	local sf="${1##*/}" my_pn="${2:-${PN}}"
+	local sf="${T}/${1##*/}" my_pn="${2:-${PN}}" ret
 	ebegin "Installing site initialisation file for GNU Emacs"
-	cp "$1" "${T}/${sf}"
+	cp "$1" "${sf}"
 	sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \
-		-e "s:@SITEETC@:${SITEETC}/${my_pn}:g" "${T}/${sf}"
+		-e "s:@SITEETC@:${SITEETC}/${my_pn}:g" "${sf}"
 	( # subshell to avoid pollution of calling environment
 		insinto "${SITELISP}/site-gentoo.d"
-		doins "${T}/${sf}"
+		doins "${sf}"
 	)
-	eend $? "doins failed"
+	ret=$?
+	rm -f "${sf}"
+	eend ${ret} "doins failed"
 }
 
 # @FUNCTION: elisp-site-regen
@@ -285,11 +288,12 @@
 elisp-site-regen() {
 	local i sf line obsolete
 	local -a sflist
+	local tmpdir=${T:-/tmp}
 
 	if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \
 		&& [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then
 		einfo "Creating default ${SITELISP}/site-start.el ..."
-		cat <<-EOF >"${T}"/site-start.el
+		cat <<-EOF >"${tmpdir}"/site-start.el
 		;;; site-start.el
 
 		;;; Commentary:
@@ -330,7 +334,7 @@
 
 	eval "${old_shopts}"
 
-	cat <<-EOF >"${T}"/site-gentoo.el
+	cat <<-EOF >"${tmpdir}"/site-gentoo.el
 	;;; site-gentoo.el --- site initialisation for Gentoo-installed packages
 
 	;;; Commentary:
@@ -339,8 +343,8 @@
 
 	;;; Code:
 	EOF
-	cat "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el
-	cat <<-EOF >>"${T}"/site-gentoo.el
+	cat "${sflist[@]}" </dev/null >>"${tmpdir}"/site-gentoo.el
+	cat <<-EOF >>"${tmpdir}"/site-gentoo.el
 
 	(provide 'site-gentoo)
 
@@ -350,16 +354,17 @@
 	;;; site-gentoo.el ends here
 	EOF
 
-	if cmp -s "${ROOT}${SITELISP}"/site-gentoo.el "${T}"/site-gentoo.el; then
+	if cmp -s "${ROOT}${SITELISP}"/site-gentoo.el "${tmpdir}"/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.
 		echo " no changes."
 	else
-		mv "${T}"/site-gentoo.el "${ROOT}${SITELISP}"/site-gentoo.el
-		[ -f "${T}"/site-start.el ] \
+		mv "${tmpdir}"/site-gentoo.el "${ROOT}${SITELISP}"/site-gentoo.el
+		[ -f "${tmpdir}"/site-start.el ] \
 			&& [ ! -e "${ROOT}${SITELISP}"/site-start.el ] \
-			&& mv "${T}"/site-start.el "${ROOT}${SITELISP}"/site-start.el
+			&& mv "${tmpdir}"/site-start.el "${ROOT}${SITELISP}"/site-start.el
 		echo; einfo
 		for sf in "${sflist[@]##*/}"; do
 			einfo "  Adding ${sf} ..."
@@ -404,4 +409,7 @@
 		[ "${sf%/*}" = "${ROOT}${SITELISP}/site-gentoo.d" ] \
 			&& cat "${sf}" >>"${ROOT}${SITELISP}"/00site-gentoo.el
 	done
+
+	# cleanup
+	rm -f "${tmpdir}"/site-{gentoo,start}.el
 }



-- 
gentoo-commits@lists.gentoo.org mailing list



             reply	other threads:[~2008-03-07  8:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07  8:19 Ulrich Mueller (ulm) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-05-25 12:52 [gentoo-commits] gentoo-x86 commit in eclass: elisp-common.eclass Ulrich Mueller (ulm)
2014-06-11  9:13 Ulrich Mueller (ulm)
2011-10-09  9:10 Ulrich Mueller (ulm)
2011-08-13 12:19 Ulrich Mueller (ulm)
2011-02-19 10:12 Ulrich Mueller (ulm)
2010-11-29 17:07 Ulrich Mueller (ulm)
2010-10-09 15:30 Ulrich Mueller (ulm)
2010-09-17  7:41 Ulrich Mueller (ulm)
2009-12-29 20:15 Ulrich Mueller (ulm)
2009-12-07 21:05 Ulrich Mueller (ulm)
2009-11-22 12:06 Ulrich Mueller (ulm)
2009-05-25 16:25 Christian Faulhammer (fauli)
2009-04-14 15:45 Ulrich Mueller (ulm)
2009-04-08 10:47 Ulrich Mueller (ulm)
2009-03-12 14:10 Ulrich Mueller (ulm)
2009-02-13 17:15 Ulrich Mueller (ulm)
2009-01-31 21:31 Ulrich Mueller (ulm)
2009-01-31 20:58 Ulrich Mueller (ulm)
2008-11-24 14:21 Ulrich Mueller (ulm)
2008-10-27 21:34 Ulrich Mueller (ulm)
2008-10-12 19:48 Ulrich Mueller (ulm)
2008-10-05 13:56 Ulrich Mueller (ulm)
2008-09-24  9:47 Ulrich Mueller (ulm)
2008-09-01 10:45 Ulrich Mueller (ulm)
2008-08-27 11:21 Ulrich Mueller (ulm)
2008-08-27  6:53 Ulrich Mueller (ulm)
2008-08-10 16:54 Ulrich Mueller (ulm)
2008-07-01 22:10 Ulrich Mueller (ulm)
2008-05-18  6:15 Ulrich Mueller (ulm)
2008-04-12  8:40 Ulrich Mueller (ulm)
2008-04-04 18:11 Ulrich Mueller (ulm)
2008-02-22  9:30 Ulrich Mueller (ulm)
2008-02-22  9:28 Ulrich Mueller (ulm)
2007-12-12 21:58 Ulrich Mueller (ulm)
2007-12-11 12:28 Ulrich Mueller (ulm)
2007-12-01 15:35 Ulrich Mueller (ulm)
2007-11-17 15:39 Ulrich Mueller (ulm)

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=E1JXXnT-00011e-MU@stork.gentoo.org \
    --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