Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Ulrich Mueller (ulm)" <ulm@g.o>
Subject: gentoo-x86 commit in eclass: elisp-common.eclass
Date: Wed, 08 Apr 2009 10:47:43 +0000
ulm         09/04/08 10:47:43

  Modified:             elisp-common.eclass
  Log:
  Partial sync from Emacs overlay:
  In elisp-site-file-install, allow for extra version identifier in the
  name of the source file; output a warning if the file name doesn't match
  a valid pattern; automagically insert a header comment.

Revision  Changes    Path
1.59                 eclass/elisp-common.eclass

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

Index: elisp-common.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- elisp-common.eclass	26 Mar 2009 14:14:22 -0000	1.58
+++ elisp-common.eclass	8 Apr 2009 10:47:42 -0000	1.59
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.58 2009/03/26 14:14:22 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.59 2009/04/08 10:47:42 ulm Exp $
 #
 # Copyright 2002-2004 Matthew Kennedy <mkennedy@g.o>
 # Copyright 2003      Jeremy Maitin-Shepard <jbms@...>
@@ -86,7 +86,7 @@
 # settings.  Give a hint in pkg_postinst(), which should be enough.
 #
 # The naming scheme for this site-init file matches the shell pattern
-# "[1-8][0-9]*-gentoo.el", where the two digits at the beginning define
+# "[1-8][0-9]*-gentoo*.el", where the two digits at the beginning define
 # the loading order (numbers below 10 or above 89 are reserved for
 # internal use).  So if your initialisation depends on another Emacs
 # package, your site file's number must be higher!
@@ -100,8 +100,11 @@
 #
 #   	elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
 #
-# in src_install().  If your subdirectory is not named ${PN}, give the
-# differing name as second argument.
+# in src_install().  Any characters after the "-gentoo" part and before
+# the extension will be stripped from the destination file's name.
+# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as
+# "50${PN}-gentoo.el".  If your subdirectory is not named ${PN}, give
+# the differing name as second argument.
 #
 # .SS
 # pkg_postinst() / pkg_postrm() usage:
@@ -243,13 +246,23 @@
 # @FUNCTION: elisp-site-file-install
 # @USAGE: <site-init file> [subdirectory]
 # @DESCRIPTION:
-# Install Emacs site-init file in SITELISP directory.
+# Install Emacs site-init file in SITELISP directory.  Automatically
+# inserts a standard comment header with the name of the package (unless
+# it is already present).  Tokens @SITELISP@ and @SITEETC@ are replaced
+# by the path to the package's subdirectory in SITELISP and SITEETC,
+# respectively.
 
 elisp-site-file-install() {
-	local sf="${T}/${1##*/}" my_pn="${2:-${PN}}" ret
+	local sf="${1##*/}" my_pn="${2:-${PN}}" ret
+	local header=";;; ${PN} site-lisp configuration"
+
+	[[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
+		|| ewarn "elisp-site-file-install: bad name of site-init file"
+	sf="${T}/${sf/%-gentoo*.el/-gentoo.el}"
 	ebegin "Installing site initialisation file for GNU Emacs"
 	cp "$1" "${sf}"
-	sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \
+	sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \
+		-e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \
 		-e "s:@SITEETC@:${SITEETC}/${my_pn}:g;\$q" "${sf}"
 	( # subshell to avoid pollution of calling environment
 		insinto "${SITELISP}/site-gentoo.d"





Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in eclass: elisp-common.eclass
Next by thread:
gentoo-x86 commit in eclass: elisp-common.eclass
Previous by date:
gentoo-x86 commit in sys-kernel/vanilla-sources: vanilla-sources-2.6.30_rc1.ebuild ChangeLog
Next by date:
gentoo-x86 commit in app-emacs/mairix: - New directory


Updated Apr 29, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.