/[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.65 Revision 1.66
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2010 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.65 2009/12/29 20:15:12 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.66 2010/08/22 08:30:32 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 <fauli@gentoo.org> 8# Copyright 2007-2008 Christian Faulhammer <fauli@gentoo.org>
9# Copyright 2007-2009 Ulrich Müller <ulm@gentoo.org> 9# Copyright 2007-2010 Ulrich Müller <ulm@gentoo.org>
10# 10#
11# @ECLASS: elisp-common.eclass 11# @ECLASS: elisp-common.eclass
12# @MAINTAINER: 12# @MAINTAINER:
13# Feel free to contact the Emacs team through <emacs@gentoo.org> if you 13# Feel free to contact the Emacs team through <emacs@gentoo.org> if you
14# have problems, suggestions or questions. 14# have problems, suggestions or questions.
301 301
302 # Until January 2009, elisp-common.eclass sometimes created an 302 # Until January 2009, elisp-common.eclass sometimes created an
303 # auxiliary file for backwards compatibility. Remove any such file. 303 # auxiliary file for backwards compatibility. Remove any such file.
304 rm -f "${sitelisp}"/00site-gentoo.el 304 rm -f "${sitelisp}"/00site-gentoo.el
305 305
306 # set nullglob option, there may be a directory without matching files
307 local old_shopts=$(shopt -p nullglob)
308 shopt -s nullglob
309
310 for sf in "${sitelisp}"/[0-9][0-9]*-gentoo.el \ 306 for sf in "${sitelisp}"/[0-9][0-9]*-gentoo.el \
311 "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el 307 "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el
312 do 308 do
313 [ -r "${sf}" ] || continue 309 [ -r "${sf}" ] || continue
314 # sort files by their basename. straight insertion sort. 310 # sort files by their basename. straight insertion sort.
317 sflist[i]=${sflist[i-1]} 313 sflist[i]=${sflist[i-1]}
318 done 314 done
319 sflist[i]=${sf} 315 sflist[i]=${sf}
320 done 316 done
321 317
322 eval "${old_shopts}"
323
324 cat <<-EOF >"${T}"/site-gentoo.el 318 cat <<-EOF >"${T}"/site-gentoo.el
325 ;;; site-gentoo.el --- site initialisation for Gentoo-installed packages 319 ;;; site-gentoo.el --- site initialisation for Gentoo-installed packages
326 320
327 ;;; Commentary: 321 ;;; Commentary:
328 ;; Automatically generated by elisp-common.eclass 322 ;; Automatically generated by elisp-common.eclass
347 341
348 if cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then 342 if cmp -s "${sitelisp}"/site-gentoo.el "${T}"/site-gentoo.el; then
349 # This prevents outputting unnecessary text when there 343 # This prevents outputting unnecessary text when there
350 # was actually no change. 344 # was actually no change.
351 # A case is a remerge where we have doubled output. 345 # A case is a remerge where we have doubled output.
346 rm -f "${T}"/site-gentoo.el
352 echo " no changes." 347 echo " no changes."
353 else 348 else
354 mv "${T}"/site-gentoo.el "${sitelisp}"/site-gentoo.el 349 mv "${T}"/site-gentoo.el "${sitelisp}"/site-gentoo.el
355 echo 350 echo
356 case ${#sflist[@]} in 351 case ${#sflist[@]} in
358 1) einfo "... ${#sflist[@]} site initialisation file included." ;; 353 1) einfo "... ${#sflist[@]} site initialisation file included." ;;
359 *) einfo "... ${#sflist[@]} site initialisation files included." ;; 354 *) einfo "... ${#sflist[@]} site initialisation files included." ;;
360 esac 355 esac
361 fi 356 fi
362 357
363 # cleanup
364 rm -f "${T}"/site-gentoo.el
365
366 return 0 358 return 0
367} 359}

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.66

  ViewVC Help
Powered by ViewVC 1.1.20