diff options
author | Ulrich Müller <ulm@gentoo.org> | 2009-12-07 21:05:08 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2009-12-07 21:05:08 +0000 |
commit | ea24c1649a056af8c4ba288502bc8013d488c986 (patch) | |
tree | f76769cf646057870de5f033c0a2bbcfef0cddf8 /eclass/elisp-common.eclass | |
parent | Fix x86 compile issue. Thanks to Fabian Groffen. (diff) | |
download | historical-ea24c1649a056af8c4ba288502bc8013d488c986.tar.gz historical-ea24c1649a056af8c4ba288502bc8013d488c986.tar.bz2 historical-ea24c1649a056af8c4ba288502bc8013d488c986.zip |
Partial sync from Emacs overlay (revision 1477).
Prepare for Prefix support.
Diffstat (limited to 'eclass/elisp-common.eclass')
-rw-r--r-- | eclass/elisp-common.eclass | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 11f180e445a3..fd8d61761f05 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -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.63 2009/11/22 12:06:43 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.64 2009/12/07 21:05:08 ulm Exp $ # # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> @@ -143,7 +143,7 @@ SITEETC=/usr/share/emacs/etc # @ECLASS-VARIABLE: EMACS # @DESCRIPTION: # Path of Emacs executable. -EMACS=/usr/bin/emacs +EMACS=${EPREFIX}/usr/bin/emacs # @ECLASS-VARIABLE: EMACSFLAGS # @DESCRIPTION: @@ -261,8 +261,8 @@ elisp-site-file-install() { ebegin "Installing site initialisation file for GNU Emacs" [[ $1 = ${sf} ]] || cp "$1" "${sf}" 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}" + -e "s:@SITELISP@:${EPREFIX}${SITELISP}/${my_pn}:g" \ + -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g;\$q" "${sf}" ( # subshell to avoid pollution of calling environment insinto "${SITELISP}/site-gentoo.d" doins "${sf}" @@ -283,11 +283,12 @@ elisp-site-file-install() { # location is still supported when generating site-gentoo.el. elisp-site-regen() { + local sitelisp=${ROOT}${EPREFIX}${SITELISP} local i sf line obsolete null="" page=$'\f' local -a sflist - if [ ! -d "${ROOT}${SITELISP}" ]; then - eerror "elisp-site-regen: Directory ${SITELISP} does not exist" + if [ ! -d "${sitelisp}" ]; then + eerror "elisp-site-regen: Directory ${sitelisp} does not exist" return 1 fi @@ -300,14 +301,14 @@ elisp-site-regen() { # Until January 2009, elisp-common.eclass sometimes created an # auxiliary file for backwards compatibility. Remove any such file. - rm -f "${ROOT}${SITELISP}"/00site-gentoo.el + rm -f "${sitelisp}"/00site-gentoo.el # set nullglob option, there may be a directory without matching files local old_shopts=$(shopt -p nullglob) shopt -s nullglob - for sf in "${ROOT}${SITELISP}"/[0-9][0-9]*-gentoo.el \ - "${ROOT}${SITELISP}"/site-gentoo.d/[0-9][0-9]*.el + for sf in "${sitelisp}"/[0-9][0-9]*-gentoo.el \ + "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el do [ -r "${sf}" ] || continue # sort files by their basename. straight insertion sort. @@ -317,7 +318,7 @@ elisp-site-regen() { done sflist[i]=${sf} # set a flag if there are obsolete files - [ "${sf%/*}" = "${ROOT}${SITELISP}" ] && obsolete=t + [ "${sf%/*}" = "${sitelisp}" ] && obsolete=t done eval "${old_shopts}" @@ -346,14 +347,13 @@ elisp-site-regen() { ;;; site-gentoo.el ends here EOF - if cmp -s "${ROOT}${SITELISP}"/site-gentoo.el "${T}"/site-gentoo.el - then + if cmp -s "${sitelisp}"/site-gentoo.el "${T}"/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 + mv "${T}"/site-gentoo.el "${sitelisp}"/site-gentoo.el echo case ${#sflist[@]} in 0) ewarn "... Huh? No site initialisation files found." ;; |