From: "Ulrich Mueller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
Date: Fri, 22 Jun 2012 17:29:23 +0000 (UTC) [thread overview]
Message-ID: <1182034010.7b3a0c7090e207743e8940c0bb01084d4c39c74c.ulm@gentoo> (raw)
commit: 7b3a0c7090e207743e8940c0bb01084d4c39c74c
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 16 22:46:50 2007 +0000
Commit: Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jun 16 22:46:50 2007 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=7b3a0c70
Call env.eselect module; it supports the "noldconfig" option since eselect version 1.0.10.
svn path=/emacs-extra/eselect-emacs/; revision=414
---
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 <ulm@gentoo.org>
+
+ * 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 <ulm@gentoo.org>
* 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 = $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*\([0-9.]*\).*/\1/;q' \
ChangeLog)
P = $(PN)-$(PV)
-DISTFILES = emacs.eselect env-emacs.eselect emacs.eselect.5
+DISTFILES = emacs.eselect emacs.eselect.5
.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}"
# update /etc/profile.env from /etc/env.d files
- #do_action env-emacs update --no-ldconfig
- env-update --no-ldconfig
+ # requires >=eselect-1.0.10 for "noldconfig" option
+ do_action env update noldconfig
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="Manage environment variables set in /etc/env.d/"
-#MAINTAINER="kugelfang@gentoo.org"
-MAINTAINER="emacs@gentoo.org"
-SVN_DATE='$Date$'
-VERSION=$(svn_date_to_version "${SVN_DATE}" )
-
-# Classes of env-vars
-SPACE_CLASS="CONFIG_PROTECT
- CONFIG_PROTECT_MASK"
-PATH_CLASS="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="text/plain text/x-makefile"
-
-# Configuration files
-ENVPROFILE="${ROOT}/etc/profile.env"
-LDCONFIG="${ROOT}/etc/ld.so.conf"
-PRELINK="${ROOT}/etc/prelink.conf"
-LDMTIMEDB="${ROOT}/var/lib/eselect/env/ld-mtimedb"
-
-# Keep all stored LDPATHS
-ESELECT_LDPATH=( )
-
-# 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=${1}
-
- # Make sure it is a file and no backup file
- [[ -f ${envfile} ]] || return 1
- [[ -n ${envfile##*~} ]] || return 1
- [[ ${envfile##*.} != bak ]] || return 1
-
- mime=$(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=( ${ROOT}/etc/env.d/* )
-
- for envfile in ${envfiles[@]} ; do
- is_envfile ${envfile} || continue
-
- value=$(load_config_ ${envfile} COLON_SEPARATED)
- for x in ${value} ; do
- has ${x} ${PATH_CLASS} && continue
- PATH_CLASS="${PATH_CLASS} ${x}"
- done
-
- value=$(load_config_ ${envfile} SPACE_SEPARATED)
- for x in ${value} ; do
- has ${x} ${SPACE_CLASS} && continue
- SPACE_CLASS="${SPACE_CLASS} ${x}"
- done
- done
-}
-
-# create_profile_env()
-# Create profile.env file
-create_profile_env() {
- local -a envfiles
- local vars store items tmpprofile
- envfiles=( ${ROOT}/etc/env.d/* )
-
- # Blank the file first!
- tmpprofile="$(mktemp ${ROOT}/tmp/profile.XXXXXX)"
- [[ $? = 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=$(sed \
- -e '/^#/d' -e '/^\s*$/d' -e '/^.*=/s/^\([^=]*\)=.*/\1/' \
- ${envfile})
- [[ -z ${vars} ]] && continue
- for var in ${vars} ; do
- # Colon separated?...
- if has ${var} ${PATH_CLASS} ; then
- store=$(load_config_ ${tmpprofile} ${var})
- if [[ -z ${store} ]] ; then
- store=$(load_config_ ${envfile} ${var})
- else
- items="$(load_config_ ${envfile} ${var})"
- items=( ${items//:/ } )
- for item in ${items[@]} ; do
- has ${item} ${store//:/ } && continue
- store="${store}:${item}"
- done
- fi
- store_config ${tmpprofile} ${var} "${store#:}"
- continue
- fi
- # Space separated!...
- if has ${var} ${SPACE_CLASS} ; then
- store=( $(load_config_ ${tmpprofile} ${var}) )
- if [[ -z ${store[@]} ]] ; then
- store=( $(load_config_ ${envfile} ${var}) )
- else
- items=( $(load_config_ ${envfile} ${var}) )
- for item in ${items[@]} ; do
- has ${item} ${store[@]} && continue
- store=( ${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
-
- has LDPATH ${vars} || continue
- # Store LDPATH for later processing
- items=$(load_config_ ${envfile} LDPATH)
- items=( ${items//:/ } )
- for item in ${items[@]} ; do
- has ${item} ${LDPATH[@]} && continue
- ESELECT_LDPATH=( ${ESELECT_LDPATH[@]} ${item} )
- done
- done
-
- # Move new file onto old one
- ENVPROFILE=$(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}/etc/env.d/*'
-
- local str
- str="# ld.so.conf autogenerated by eselect\n"
- str="${str}# Make all changes to /etc/env.d files\n"
- for x in ${ESELECT_LDPATH[@]} ; do
- str="${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}/etc/env.d/*'
- local str
- str="# prelink.conf autogenerated by eselect\n"
- str="${str}# Make all changes to /etc/env.d files\n"
- # Add default items
- for x in /bin /sbin /usr/bin /usr/sbin ; do
- str="${str}-l ${x}\n"
- done
- for x in $(list_libdirs) ; do
- [[ -e ${ROOT}/${x} ]] && str="${str}-l /${x}\n"
- [[ -e ${ROOT}/usr/${x} ]] && str="${str}-l /usr/${x}\n"
- done
- prelink_mask=$(load_config_ ${ENVPROFILE} PRELINK_PATH_MASK)
- prelink_mask=( ${prelink_mask//:/ } )
- prelink="$(load_config_ ${ENVPROFILE} PATH)"
- prelink="${prelink} $(load_config_ ${ENVPROFILE} PRELINK_PATH)"
- prelink=( ${prelink//:/ } ${ESELECT_LDPATH[@]} )
- for x in ${prelink[@]} ; do
- has ${x} ${prelink_mask} && continue
- [[ -z ${x##*/} ]] || x="${x}/"
- str="${str}-h ${x}\n"
- done
- for x in ${prelink_mask[@]} ; do
- str="${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=1
- for x in ${ESELECT_LDPATH[@]} ; do
- y=${x//\//_}
- y=${y//-/_}
- y=${y//./_}
- y=${y//+/_}
- oldmtime=$(load_config_ ${LDMTIMEDB} "mtime${y}")
- newmtime=$(stat -c %Y ${x} 2> /dev/null)
- if [[ ${oldmtime} != ${newmtime} ]] ; then
- ret=0
- 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 "<makelinks>"
-}
-
-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=1 ;;
- --no-ldconfig) noldconfig=1 ;;
- *) 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=$( ( need_links || [[ "${mlinks}" ]] ) && echo "-X" )
- update_ldcache ${makelinks}
- fi
-
- # fix up ${ENVPROFILE}
- cp ${ENVPROFILE} ${ENVPROFILE/.env/.csh}
- sed -i \
- -e "s/^\(.*\)=\"\(.*\)\"/export \1='\2'/" \
- $(canonicalise ${ENVPROFILE})
- sed -i \
- -e "s/^\(.*\)=\"\(.*\)\"/setenv \1 '\2'/" \
- $(canonicalise ${ENVPROFILE/.env/.csh})
-}
-
-# vim: ft=eselect
next reply other threads:[~2012-06-22 17:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 17:29 Ulrich Mueller [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-22 17:29 [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: / Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
2012-06-22 17:29 Ulrich Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1182034010.7b3a0c7090e207743e8940c0bb01084d4c39c74c.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox