From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1J24Dc-0000Dj-84 for garchives@archives.gentoo.org; Tue, 11 Dec 2007 12:28:12 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lBBCS9Yp003791; Tue, 11 Dec 2007 12:28:09 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lBBCS8l3003760 for ; Tue, 11 Dec 2007 12:28:08 GMT Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id DBDB7657F0 for ; Tue, 11 Dec 2007 12:28:07 +0000 (UTC) Received: from ulm by stork.gentoo.org with local (Exim 4.60) (envelope-from ) id 1J24DW-0000i5-E8 for gentoo-commits@lists.gentoo.org; Tue, 11 Dec 2007 12:28:06 +0000 From: "Ulrich Mueller (ulm)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, ulm@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: elisp-common.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: elisp-common.eclass X-VCS-Directories: eclass X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: Sender: Ulrich Mueller Date: Tue, 11 Dec 2007 12:28:06 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@gentoo.org X-Archives-Salt: dbfc135a-d48f-4998-8586-6225d4df344c X-Archives-Hash: 9f57ff17bd925216f53aab253d087869 ulm 07/12/11 12:28:06 Modified: elisp-common.eclass Log: Partial sync from Emacs overlay: Prepare for migration of packages' site files to site-gentoo.d subdirectory. Use bash arrays and a custom sort routine in elisp-site-regen. Set nullglob option, because there may be a directory without matching files. Use ebegin/eend instead of einfo where it is feasible. Revision Changes Path 1.32 eclass/elisp-common.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?rev=1.32&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?rev=1.32&content-type=text/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?r1=1.31&r2=1.32 Index: elisp-common.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- elisp-common.eclass 1 Dec 2007 15:35:02 -0000 1.31 +++ elisp-common.eclass 11 Dec 2007 12:28:05 -0000 1.32 @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.31 2007/12/01 15:35:02 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.32 2007/12/11 12:28:05 ulm Exp $ # # Copyright 2007 Christian Faulhammer # Copyright 2002-2004 Matthew Kennedy @@ -150,8 +150,9 @@ # Byte-compile Emacs Lisp files. elisp-compile() { - einfo "Compiling GNU Emacs Elisp files ..." + ebegin "Compiling GNU Emacs Elisp files" ${EMACS} ${EMACSFLAGS} -f batch-byte-compile "$@" + eend $? "batch-byte-compile failed" } # @FUNCTION: elisp-comp @@ -175,7 +176,7 @@ [ $# -gt 0 ] || return 1 - einfo "Compiling GNU Emacs Elisp files ..." + ebegin "Compiling GNU Emacs Elisp files" tempdir=elc.$$ mkdir ${tempdir} @@ -189,6 +190,8 @@ popd rm -fr ${tempdir} + + eend ${ret} "batch-byte-compile failed" return ${ret} } @@ -210,7 +213,7 @@ elisp-make-autoload-file() { local f="${1:-${PN}-autoloads.el}" shift - einfo "Generating autoload file for GNU Emacs ..." + ebegin "Generating autoload file for GNU Emacs" sed 's/^FF/\f/' >"${f}" <<-EOF ;;; ${f##*/} --- autoloads for ${P} @@ -233,6 +236,8 @@ --eval "(setq make-backup-files nil)" \ --eval "(setq generated-autoload-file (expand-file-name \"${f}\"))" \ -f batch-update-autoloads "${@-.}" + + eend $? "batch-update-autoloads failed" } # @FUNCTION: elisp-install @@ -243,11 +248,12 @@ elisp-install() { local subdir="$1" shift - einfo "Installing Elisp files for GNU Emacs support ..." + ebegin "Installing Elisp files for GNU Emacs support" ( # subshell to avoid pollution of calling environment insinto "${SITELISP}/${subdir}" doins "$@" ) + eend $? "doins failed" } # @FUNCTION: elisp-site-file-install @@ -257,7 +263,7 @@ elisp-site-file-install() { local sf="$1" my_pn="${2:-${PN}}" - einfo "Installing site initialisation file for GNU Emacs ..." + ebegin "Installing site initialisation file for GNU Emacs" cp "${sf}" "${T}" sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \ -e "s:@SITEETC@:${SITEETC}/${my_pn}:g" "${T}/${sf##*/}" @@ -265,14 +271,20 @@ insinto "${SITELISP}" doins "${T}/${sf##*/}" ) + eend $? "doins failed" } # @FUNCTION: elisp-site-regen # @DESCRIPTION: # Regenerate site-gentoo.el file. +# Old location for site initialisation files of packages was +# /usr/share/emacs/site-lisp/. It is planned to change this to +# /usr/share/emacs/site-lisp/site-gentoo.d/. + elisp-site-regen() { - local sflist sf line + local i sf line + local -a sflist if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \ && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then @@ -294,6 +306,28 @@ fi einfon "Regenerating ${SITELISP}/site-gentoo.el ..." + + # remove auxiliary file + rm -f "${ROOT}${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 + do + [ -r "${sf}" ] || continue + # sort files by their basename. straight insertion sort. + for ((i=${#sflist[@]}; i>0; i--)); do + [[ ${sf##*/} < ${sflist[i-1]##*/} ]] || break + sflist[i]=${sflist[i-1]} + done + sflist[i]=${sf} + done + + eval "${old_shopts}" + cat <<-EOF >"${T}"/site-gentoo.el ;;; site-gentoo.el --- site initialisation for Gentoo-installed packages @@ -303,14 +337,7 @@ ;;; Code: EOF - - for sf in "${ROOT}${SITELISP}"/[0-9][0-9]*-gentoo.el - do - [ -r "${sf}" ] || continue - sflist="${sflist} ${sf##*/}" - cat "${sf}" >>"${T}"/site-gentoo.el - done - + cat "${sflist[@]}" >>"${T}"/site-gentoo.el cat <<-EOF >>"${T}"/site-gentoo.el (provide 'site-gentoo) @@ -332,11 +359,13 @@ && [ ! -e "${ROOT}${SITELISP}"/site-start.el ] \ && mv "${T}"/site-start.el "${ROOT}${SITELISP}"/site-start.el echo; einfo - for sf in ${sflist}; do + for sf in "${sflist[@]##*/}"; do einfo " Adding ${sf} ..." done - while read line; do einfo "${line}"; done <>"${ROOT}${SITELISP}"/00site-gentoo.el + done } -- gentoo-commits@gentoo.org mailing list