/[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.38 Revision 1.42
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.38 2008/04/04 18:11:28 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.42 2008/08/10 16:54:22 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>
287 287
288elisp-site-regen() { 288elisp-site-regen() {
289 local i sf line obsolete 289 local i sf line obsolete
290 local -a sflist 290 local -a sflist
291 # Work around Paludis borkage: variable T is empty in pkg_postrm 291 # Work around Paludis borkage: variable T is empty in pkg_postrm
292 local tmpdir=${T:-/tmp} 292 local tmpdir=${T:-$(mktemp -d)}
293 293
294 if [ ! -d "${ROOT}${SITELISP}" ]; then 294 if [ ! -d "${ROOT}${SITELISP}" ]; then
295 eerror "Directory ${SITELISP} does not exist" 295 eerror "Directory ${SITELISP} does not exist"
296 return 1 296 return 1
297 fi 297 fi
315 EOF 315 EOF
316 fi 316 fi
317 317
318 einfon "Regenerating ${SITELISP}/site-gentoo.el ..." 318 einfon "Regenerating ${SITELISP}/site-gentoo.el ..."
319 319
320 # remove auxiliary file 320 # remove any auxiliary file (from previous run)
321 rm -f "${ROOT}${SITELISP}"/00site-gentoo.el 321 rm -f "${ROOT}${SITELISP}"/00site-gentoo.el
322 322
323 # set nullglob option, there may be a directory without matching files 323 # set nullglob option, there may be a directory without matching files
324 local old_shopts=$(shopt -p nullglob) 324 local old_shopts=$(shopt -p nullglob)
325 shopt -s nullglob 325 shopt -s nullglob
376 einfo " Adding ${sf} ..." 376 einfo " Adding ${sf} ..."
377 done 377 done
378 einfo "Regenerated ${SITELISP}/site-gentoo.el." 378 einfo "Regenerated ${SITELISP}/site-gentoo.el."
379 379
380 echo 380 echo
381 while read line; do einfo "${line}"; done <<EOF 381 while read line; do einfo "${line:- }"; done <<-EOF
382All site initialisation for Gentoo-installed packages is added to 382 All site initialisation for Gentoo-installed packages is added to
383/usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is no longer 383 /usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is not
384managed by Gentoo. You are responsible for all maintenance of 384 managed by Gentoo. You are responsible for all maintenance of
385site-start.el if there is such a file. 385 site-start.el if there is such a file.
386 386
387In order for this site initialisation to be loaded for all users 387 In order for this site initialisation to be loaded for all users
388automatically, you can add a line like this: 388 automatically, you can add a line like this:
389 389
390 (require 'site-gentoo) 390 (require 'site-gentoo)
391 391
392to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line 392 to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line
393can be added by individual users to their initialisation files, or, 393 can be added by individual users to their initialisation files, or,
394for greater flexibility, users can load individual package-specific 394 for greater flexibility, users can load individual package-specific
395initialisation files from /usr/share/emacs/site-lisp/site-gentoo.d/. 395 initialisation files from /usr/share/emacs/site-lisp/site-gentoo.d/.
396EOF 396 EOF
397 echo 397 echo
398
399 if [ "${obsolete}" ]; then
400 while read line; do ewarn "${line}"; done <<-EOF
401 Site-initialisation files of Emacs packages are now installed in
402 /usr/share/emacs/site-lisp/site-gentoo.d/. You may consider using
403 /usr/sbin/emacs-updater to rebuild the installed Emacs packages.
404 However, the old location is still supported.
405 EOF
406 echo
407 fi
408 fi 398 fi
409 399
400 if [ "${obsolete}" ]; then
401 while read line; do ewarn "${line}"; done <<-EOF
402 Site-initialisation files of Emacs packages are now installed in
403 /usr/share/emacs/site-lisp/site-gentoo.d/. We strongly recommend
404 that you use /usr/sbin/emacs-updater to rebuild the installed
405 Emacs packages.
406 EOF
407 echo
408
410 # Kludge for backwards compatibility: During pkg_postrm, old versions 409 # Kludge for backwards compatibility: During pkg_postrm, old versions
411 # of this eclass (saved in the VDB) won't find packages' site-init files 410 # of this eclass (saved in the VDB) won't find packages' site-init
412 # in the new location. So we copy them to an auxiliary file that is 411 # files in the new location. So we copy them to an auxiliary file
413 # visible to old eclass versions. 412 # that is visible to old eclass versions.
414 for sf in "${sflist[@]}"; do 413 for sf in "${sflist[@]}"; do
415 [ "${sf%/*}" = "${ROOT}${SITELISP}/site-gentoo.d" ] \ 414 [ "${sf%/*}" = "${ROOT}${SITELISP}/site-gentoo.d" ] \
416 && cat "${sf}" >>"${ROOT}${SITELISP}"/00site-gentoo.el 415 && cat "${sf}" >>"${ROOT}${SITELISP}"/00site-gentoo.el
417 done 416 done
417 fi
418 418
419 # cleanup 419 # cleanup
420 rm -f "${tmpdir}"/site-{gentoo,start}.el 420 rm -f "${tmpdir}"/site-{gentoo,start}.el
421} 421}

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.42

  ViewVC Help
Powered by ViewVC 1.1.20