From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Si7hb-0003Vt-9R for garchives@archives.gentoo.org; Fri, 22 Jun 2012 17:31:23 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2DA08E09F4; Fri, 22 Jun 2012 17:29:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DCA3CE08DA for ; Fri, 22 Jun 2012 17:29:25 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 528E71B403D for ; Fri, 22 Jun 2012 17:29:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 723C8E544E for ; Fri, 22 Jun 2012 17:29:23 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1182034010.7b3a0c7090e207743e8940c0bb01084d4c39c74c.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog Makefile emacs.eselect env-emacs.eselect X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: 7b3a0c7090e207743e8940c0bb01084d4c39c74c X-VCS-Branch: eselect-emacs-1.1 Date: Fri, 22 Jun 2012 17:29:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: dd6221ea-896e-4f02-b6fa-7666b22046d4 X-Archives-Hash: 8087507dfff5ec6f1d70dbef02fc6645 commit: 7b3a0c7090e207743e8940c0bb01084d4c39c74c Author: Ulrich M=C3=BCller gentoo org> AuthorDate: Sat Jun 16 22:46:50 2007 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Sat Jun 16 22:46:50 2007 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/emacs-tools.g= it;a=3Dcommit;h=3D7b3a0c70 Call env.eselect module; it supports the "noldconfig" option since eselec= t version 1.0.10. svn path=3D/emacs-extra/eselect-emacs/; revision=3D414 --- ChangeLog | 9 ++ Makefile | 2 +- emacs.eselect | 4 +- env-emacs.eselect | 313 -----------------------------------------------= ------ 4 files changed, 12 insertions(+), 316 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60e9870..bc46376 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-06-17 Ulrich Mueller + + * emacs.eselect (set_symlinks): Call env.eselect module; + it supports the "noldconfig" option since eselect version 1.0.10. + + * env-emacs.eselect: Remove file. + + * Makefile (DISTFILES): Undo previous change. + 2007-06-10 Ulrich Mueller =20 * env-emacs.eselect: New file, taken from env.eselect of diff --git a/Makefile b/Makefile index a6b6b73..bb830ff 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ PV =3D $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*= \([0-9.]*\).*/\1/;q' \ ChangeLog) P =3D $(PN)-$(PV) =20 -DISTFILES =3D emacs.eselect env-emacs.eselect emacs.eselect.5 +DISTFILES =3D emacs.eselect emacs.eselect.5 =20 =20 .PHONY: all dist clean diff --git a/emacs.eselect b/emacs.eselect index 0b0a9a4..90498d9 100644 --- a/emacs.eselect +++ b/emacs.eselect @@ -118,8 +118,8 @@ set_symlinks() { set_infopath "${target}" =20 # update /etc/profile.env from /etc/env.d files - #do_action env-emacs update --no-ldconfig - env-update --no-ldconfig + # requires >=3Deselect-1.0.10 for "noldconfig" option + do_action env update noldconfig =20 return 0 } diff --git a/env-emacs.eselect b/env-emacs.eselect deleted file mode 100644 index c791ca3..0000000 --- a/env-emacs.eselect +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -inherit config multilib - -DESCRIPTION=3D"Manage environment variables set in /etc/env.d/" -#MAINTAINER=3D"kugelfang@gentoo.org" -MAINTAINER=3D"emacs@gentoo.org" -SVN_DATE=3D'$Date$' -VERSION=3D$(svn_date_to_version "${SVN_DATE}" ) - -# Classes of env-vars -SPACE_CLASS=3D"CONFIG_PROTECT - CONFIG_PROTECT_MASK" -PATH_CLASS=3D"ADA_INCLUDE_PATH - ADA_OBJECT_PATH - CLASSPATH - INFODIR - INFOPATH - KDEDIRS - LDPATH - MANPATH - PATH - PKG_CONFIG_PATH - PRELINK_PATH - PRELINK_PATH_MASK - PYTHONPATH - ROOTPATH" - -# Recognized file formats: -MIME_WHITELIST=3D"text/plain text/x-makefile" - -# Configuration files -ENVPROFILE=3D"${ROOT}/etc/profile.env" -LDCONFIG=3D"${ROOT}/etc/ld.so.conf" -PRELINK=3D"${ROOT}/etc/prelink.conf" -LDMTIMEDB=3D"${ROOT}/var/lib/eselect/env/ld-mtimedb" - -# Keep all stored LDPATHS -ESELECT_LDPATH=3D( ) - -# workaround for bug #172472 -load_config_ () { - [[ ${#@} -eq 2 ]] || die - local ${2} - load_config ${@} -} - -# is_envd_file() -# Return successfuly when file can be sourced. -is_envfile() { - local mime envfile=3D${1} - - # Make sure it is a file and no backup file - [[ -f ${envfile} ]] || return 1 - [[ -n ${envfile##*~} ]] || return 1 - [[ ${envfile##*.} !=3D bak ]] || return 1 - - mime=3D$(file -i ${envfile} | cut -d ' ' -f 2 | sed -e 's/;$//') - if ! has ${mime} ${MIME_WHITELIST} ; then - echo "Skipping non-text file ${envfile}." - return 1 - fi - - return 0 -} - -# update_envvar_classes() -# Update the contents of *_CLASS based on env,d files. -update_envvar_classes() { - local -a envfiles - local value - envfiles=3D( ${ROOT}/etc/env.d/* ) - - for envfile in ${envfiles[@]} ; do - is_envfile ${envfile} || continue - - value=3D$(load_config_ ${envfile} COLON_SEPARATED) - for x in ${value} ; do - has ${x} ${PATH_CLASS} && continue - PATH_CLASS=3D"${PATH_CLASS} ${x}" - done - - value=3D$(load_config_ ${envfile} SPACE_SEPARATED) - for x in ${value} ; do - has ${x} ${SPACE_CLASS} && continue - SPACE_CLASS=3D"${SPACE_CLASS} ${x}" - done - done -} - -# create_profile_env() -# Create profile.env file -create_profile_env() { - local -a envfiles - local vars store items tmpprofile - envfiles=3D( ${ROOT}/etc/env.d/* ) -=09 - # Blank the file first! - tmpprofile=3D"$(mktemp ${ROOT}/tmp/profile.XXXXXX)" - [[ $? =3D 0 ]] || die "Couldn't create temporary file!" - - # Gather ye classes while ye may! - update_envvar_classes - - # Parse all files in env.d - for envfile in ${envfiles[@]} ; do - is_envfile ${envfile} || continue - - # Which vars are to be loaded? - # TODO: Change to bash magic? - vars=3D$(sed \ - -e '/^#/d' -e '/^\s*$/d' -e '/^.*=3D/s/^\([^=3D]*\)=3D.*/\1/' \ - ${envfile}) - [[ -z ${vars} ]] && continue - for var in ${vars} ; do - # Colon separated?... - if has ${var} ${PATH_CLASS} ; then - store=3D$(load_config_ ${tmpprofile} ${var}) - if [[ -z ${store} ]] ; then - store=3D$(load_config_ ${envfile} ${var}) - else - items=3D"$(load_config_ ${envfile} ${var})" - items=3D( ${items//:/ } ) - for item in ${items[@]} ; do - has ${item} ${store//:/ } && continue - store=3D"${store}:${item}" - done - fi - store_config ${tmpprofile} ${var} "${store#:}" - continue - fi - # Space separated!... - if has ${var} ${SPACE_CLASS} ; then - store=3D( $(load_config_ ${tmpprofile} ${var}) ) - if [[ -z ${store[@]} ]] ; then - store=3D( $(load_config_ ${envfile} ${var}) ) - else - items=3D( $(load_config_ ${envfile} ${var}) ) - for item in ${items[@]} ; do - has ${item} ${store[@]} && continue - store=3D( ${store[@]} ${item} ) - done - fi - store_config ${tmpprofile} ${var} "${store[@]}" - continue - fi - # Ok, just a non-cummultative var. - store_config \ - ${tmpprofile} \ - ${var} \ - "$(load_config_ ${envfile} ${var})" - done -=09 - has LDPATH ${vars} || continue - # Store LDPATH for later processing - items=3D$(load_config_ ${envfile} LDPATH) - items=3D( ${items//:/ } ) - for item in ${items[@]} ; do - has ${item} ${LDPATH[@]} && continue=20 - ESELECT_LDPATH=3D( ${ESELECT_LDPATH[@]} ${item} ) - done - done - - # Move new file onto old one - ENVPROFILE=3D$(canonicalise ${ENVPROFILE}) - chmod a+r ${tmpprofile} - mv ${tmpprofile} ${ENVPROFILE} \ - || die "Couldn't move ${tmpprofile} to ${ENVPROFILE}!\n - Original profile.env remains unchanged." -} - -# create_ld_so_conf() -# Create ld.so.conf file based upon gathered LDPATHs -create_ld_so_conf() { - [[ -z ${ESELECT_LDPATH[@]} ]] && die -q 'No LDPATHs found in ${ROOT}/et= c/env.d/*' - - local str - str=3D"# ld.so.conf autogenerated by eselect\n" - str=3D"${str}# Make all changes to /etc/env.d files\n" - for x in ${ESELECT_LDPATH[@]} ; do - str=3D"${str}${x}\n" - done - echo -e "${str}" > $(canonicalise ${LDCONFIG}) -} - -# create_prelink_conf() -# Create prelink.conf file based upon existing profile.env -create_prelink_conf() { - [[ -z ${ESELECT_LDPATH[@]} ]] && die -q 'No LDPATHs found in ${ROOT}/et= c/env.d/*' - local str - str=3D"# prelink.conf autogenerated by eselect\n" - str=3D"${str}# Make all changes to /etc/env.d files\n" - # Add default items - for x in /bin /sbin /usr/bin /usr/sbin ; do - str=3D"${str}-l ${x}\n"=09 - done - for x in $(list_libdirs) ; do - [[ -e ${ROOT}/${x} ]] && str=3D"${str}-l /${x}\n" - [[ -e ${ROOT}/usr/${x} ]] && str=3D"${str}-l /usr/${x}\n" - done - prelink_mask=3D$(load_config_ ${ENVPROFILE} PRELINK_PATH_MASK) - prelink_mask=3D( ${prelink_mask//:/ } ) - prelink=3D"$(load_config_ ${ENVPROFILE} PATH)" - prelink=3D"${prelink} $(load_config_ ${ENVPROFILE} PRELINK_PATH)" - prelink=3D( ${prelink//:/ } ${ESELECT_LDPATH[@]} ) - for x in ${prelink[@]} ; do - has ${x} ${prelink_mask} && continue - [[ -z ${x##*/} ]] || x=3D"${x}/" - str=3D"${str}-h ${x}\n" - done - for x in ${prelink_mask[@]} ; do - str=3D"${str}-b ${x}\n" - done - echo -e "${str}" > $(canonicalise ${PRELINK}) -} - -# need_links() -# Returns true if any item of ${LDPATH} has been modified. -need_links() { - local ret=3D1 - for x in ${ESELECT_LDPATH[@]} ; do - y=3D${x//\//_} - y=3D${y//-/_} - y=3D${y//./_} - y=3D${y//+/_} - oldmtime=3D$(load_config_ ${LDMTIMEDB} "mtime${y}") - newmtime=3D$(stat -c %Y ${x} 2> /dev/null) - if [[ ${oldmtime} !=3D ${newmtime} ]] ; then - ret=3D0 - store_config ${LDMTIMEDB} "mtime${y}" ${newmtime} - fi - done - return ${ret} -} - -# update_ldcache() -# Update ld.so.cache using ldconfig -update_ldcache() { - case $(uname -s) in - FreeBSD | DragonFly) - echo "Regenerating ${ROOT}/var/run/ld-elf.so.hints..." - ( - cd / - ldconfig -elf -i -f "${ROOT:-/}var/run/ld-elf.so.hints" \ - "${ROOT:-/}etc/ld.so.conf" - ) - ;; - *) - echo "Regenerating ${ROOT}/etc/ld.so.cache..." - ( - cd / - ldconfig ${1} -r ${ROOT:-/} - ) - ;; - esac -} - -### update action - -describe_update() { - echo "Collect environment variables from all scripts in /etc/env.d/" -} - -describe_update_parameters() { - echo "" -} - -describe_update_options() { - echo "makelinks : Specify \"makelinks\" to force updating of links" - echo "--no-ldconfig : Do not run ldconfig" -} - -do_update() { - if [[ -e ${ROOT}/etc/profile.env ]] ; then - [[ -w ${ROOT}/etc/profile.env ]] \ - || die -q "You need to be root!" - else - touch ${ROOT}/etc/profile.env - fi - - # handle --no-ldconfig option, bug #172475 - local mlinks noldconfig - while [[ ${1} ]]; do - case ${1} in - makelinks) mlinks=3D1 ;; - --no-ldconfig) noldconfig=3D1 ;; - *) die -q "Unknown parameter ${1}" ;; - esac - shift - done - - # Create configuration files - create_profile_env - if [[ -z "${noldconfig}" ]]; then - create_ld_so_conf - [[ -e ${ROOT}/usr/sbin/prelink ]] && create_prelink_conf - makelinks=3D$( ( need_links || [[ "${mlinks}" ]] ) && echo "-X" ) - update_ldcache ${makelinks} - fi - - # fix up ${ENVPROFILE} - cp ${ENVPROFILE} ${ENVPROFILE/.env/.csh} - sed -i \ - -e "s/^\(.*\)=3D\"\(.*\)\"/export \1=3D'\2'/" \ - $(canonicalise ${ENVPROFILE}) - sed -i \ - -e "s/^\(.*\)=3D\"\(.*\)\"/setenv \1 '\2'/" \ - $(canonicalise ${ENVPROFILE/.env/.csh}) -} - -# vim: ft=3Deselect