/[gentoo-x86]/eclass/elisp-common.eclass
Gentoo

Diff of /eclass/elisp-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.46 Revision 1.47
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.46 2008/09/19 08:12:48 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.47 2008/09/24 09:47:04 ulm Exp $
4# 4#
5# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> 5# Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
6# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> 6# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> 7# Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
8# Copyright 2007-2008 Christian Faulhammer <opfer@gentoo.org> 8# Copyright 2007-2008 Christian Faulhammer <opfer@gentoo.org>
310# has been changed to /usr/share/emacs/site-lisp/site-gentoo.d/. Remerge of 310# has been changed to /usr/share/emacs/site-lisp/site-gentoo.d/. Remerge of
311# packages with Emacs support is enough, the old location is still supported 311# packages with Emacs support is enough, the old location is still supported
312# when generating the start-up file. 312# when generating the start-up file.
313 313
314elisp-site-regen() { 314elisp-site-regen() {
315 local i sf line obsolete 315 local i sf line firstrun obsolete
316 local -a sflist 316 local -a sflist
317 # Work around Paludis borkage: variable T is empty in pkg_postrm 317 # Work around Paludis borkage: variable T is empty in pkg_postrm
318 local tmpdir=${T:-$(mktemp -d)} 318 local tmpdir=${T:-$(mktemp -d)}
319 319
320 if [ ! -d "${ROOT}${SITELISP}" ]; then 320 if [ ! -d "${ROOT}${SITELISP}" ]; then
321 eerror "Directory ${SITELISP} does not exist" 321 eerror "Directory ${SITELISP} does not exist"
322 return 1 322 return 1
323 fi 323 fi
324 324
325 if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \ 325 [ -e "${ROOT}${SITELISP}"/site-gentoo.el ] || firstrun=t
326
326 && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then 327 if [ "${firstrun}" ] && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then
327 einfo "Creating default ${SITELISP}/site-start.el ..." 328 einfo "Creating default ${SITELISP}/site-start.el ..."
328 cat <<-EOF >"${tmpdir}"/site-start.el 329 cat <<-EOF >"${tmpdir}"/site-start.el
329 ;;; site-start.el 330 ;;; site-start.el
330 331
331 ;;; Commentary: 332 ;;; Commentary:
396 mv "${tmpdir}"/site-gentoo.el "${ROOT}${SITELISP}"/site-gentoo.el 397 mv "${tmpdir}"/site-gentoo.el "${ROOT}${SITELISP}"/site-gentoo.el
397 [ -f "${tmpdir}"/site-start.el ] \ 398 [ -f "${tmpdir}"/site-start.el ] \
398 && [ ! -e "${ROOT}${SITELISP}"/site-start.el ] \ 399 && [ ! -e "${ROOT}${SITELISP}"/site-start.el ] \
399 && mv "${tmpdir}"/site-start.el "${ROOT}${SITELISP}"/site-start.el 400 && mv "${tmpdir}"/site-start.el "${ROOT}${SITELISP}"/site-start.el
400 echo 401 echo
401 for sf in "${sflist[@]##*/}"; do 402 einfo "... ${#sflist[@]} site initialisation file(s) included."
402 einfo " Adding ${sf} ..." 403 fi
403 done
404 einfo "Regenerated ${SITELISP}/site-gentoo.el."
405 404
405 if [ "${firstrun}" ]; then
406 echo 406 echo
407 while read line; do einfo "${line:- }"; done <<-EOF 407 while read line; do einfo "${line:- }"; done <<-EOF
408 All site initialisation for Gentoo-installed packages is added to 408 All site initialisation for Gentoo-installed packages is added to
409 /usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is not 409 /usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is not
410 managed by Gentoo. You are responsible for all maintenance of 410 managed by Gentoo. You are responsible for all maintenance of

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

  ViewVC Help
Powered by ViewVC 1.1.20