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 1SR48b-00069W-J3 for garchives@archives.gentoo.org; Sun, 06 May 2012 16:16:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D07FE0923; Sun, 6 May 2012 16:06:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E03FFE08BD for ; Sun, 6 May 2012 16:06:17 +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 5A65D1B4099 for ; Sun, 6 May 2012 16:06:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1FFEBE542C for ; Sun, 6 May 2012 16:06:16 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1258201092.7781f97077e6b19c642d61f49eaa29ab8b976bdc.sping@gentoo> Subject: [gentoo-commits] proj/emacs-tools:eselect-emacs commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog ctags.eselect emacs.eselect X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 7781f97077e6b19c642d61f49eaa29ab8b976bdc X-VCS-Branch: eselect-emacs Date: Sun, 6 May 2012 16:06:16 +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: e042aee6-f1aa-4b04-83fd-cc62e94f13c4 X-Archives-Hash: ec571e5f243aca768ec8328bd9d4708d commit: 7781f97077e6b19c642d61f49eaa29ab8b976bdc Author: Ulrich M=C3=BCller gentoo org> AuthorDate: Sat Nov 14 12:18:12 2009 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Sat Nov 14 12:18:12 2009 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/emacs-tools.g= it;a=3Dcommit;h=3D7781f970 Remove now unnecessary global variables for directories. svn path=3D/eselect-emacs/; revision=3D1457 --- ChangeLog | 4 ++- ctags.eselect | 56 ++++++++++++++++++++++-------------------------- emacs.eselect | 65 ++++++++++++++++++++++++++-------------------------= ----- 3 files changed, 59 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73b51cc..07330ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 2009-11-14 Ulrich Mueller =20 * ctags.eselect: - * emacs.eselect: Use EROOT and EPREFIX throughout. + * emacs.eselect: Use EROOT and EPREFIX throughout; these variables + exist in >=3Deselect-1.2. Remove now unnecessary global variables + for directories. See bug 251847. =20 2009-11-07 Ulrich Mueller =20 diff --git a/ctags.eselect b/ctags.eselect index 1033a4c..989b74d 100644 --- a/ctags.eselect +++ b/ctags.eselect @@ -24,10 +24,7 @@ #CTAGS=3D${ESELECT_MODULE_NAME:-$(basename "${BASH_SOURCE[0]%.*}")} CTAGS=3Dctags =20 -bindir=3D/usr/bin -man1dir=3D/usr/share/man/man1 - -DESCRIPTION=3D"Manage ${bindir}/${CTAGS} implementations" +DESCRIPTION=3D"Manage /usr/bin/${CTAGS} implementations" MAINTAINER=3D"emacs@gentoo.org" SVN_DATE=3D'$Date$' VERSION=3D$(svn_date_to_version "${SVN_DATE}") @@ -39,11 +36,11 @@ find_targets() { # currently active Emacs version (selected by emacs.eselect) # The logic here is the same as in emacs.eselect, don't change it! local emacs - if [[ -L ${EROOT}${bindir}/emacs && -e ${EROOT}${bindir}/emacs ]]; then - emacs=3D$(basename "$(readlink "${EROOT}${bindir}/emacs")") - [[ -f ${EROOT}${bindir}/${CTAGS}-${emacs} ]] && echo "${CTAGS}-${emacs= }" - elif [[ -f ${EROOT}${bindir}/xemacs ]]; then - [[ -f ${EROOT}${bindir}/${CTAGS}-xemacs ]] && echo "${CTAGS}-xemacs" + if [[ -L ${EROOT}/usr/bin/emacs && -e ${EROOT}/usr/bin/emacs ]]; then + emacs=3D$(basename "$(readlink "${EROOT}/usr/bin/emacs")") + [[ -f ${EROOT}/usr/bin/${CTAGS}-${emacs} ]] && echo "${CTAGS}-${emacs}= " + elif [[ -f ${EROOT}/usr/bin/xemacs ]]; then + [[ -f ${EROOT}/usr/bin/${CTAGS}-xemacs ]] && echo "${CTAGS}-xemacs" elif [[ ${CTAGS} =3D etags ]]; then # We are called as etags module, but no (X)Emacs is installed. # Return an empty list in this case, because we don't want @@ -53,31 +50,30 @@ find_targets() { fi =20 # Exuberant ctags - [[ -f ${EROOT}${bindir}/exuberant-ctags ]] && echo exuberant-ctags + [[ -f ${EROOT}/usr/bin/exuberant-ctags ]] && echo exuberant-ctags } =20 remove_symlinks() { # Remove existing symlinks to binary and man page - rm -f "${EROOT}${bindir}/${CTAGS}" \ - "${EROOT}${man1dir}"/${CTAGS}.1* + rm -f "${EROOT}/usr/bin/${CTAGS}" "${EROOT}"/usr/share/man/man1/${CTAGS= }.1* } =20 set_bin_symlinks() { # Set symlink to binary local target=3D${1} - ln -s "${target}" "${EROOT}${bindir}/${CTAGS}" \ - || die "Couldn't set ${target} ${EROOT}${bindir}/${CTAGS} symlink" + ln -s "${target}" "${EROOT}/usr/bin/${CTAGS}" \ + || die "Couldn't set ${target} ${EROOT}/usr/bin/${CTAGS} symlink" } =20 set_man_symlinks() { # Set symlink to man page local target=3D${1} extension i - for i in "${EROOT}${man1dir}"/${target}.1*; do + for i in "${EROOT}"/usr/share/man/man1/${target}.1*; do if [[ -f ${i} ]]; then # target file exists; determine compress extension extension=3D${i##*/${target}.1} ln -s "${target}.1${extension}" \ - "${EROOT}${man1dir}/${CTAGS}.1${extension}" + "${EROOT}/usr/share/man/man1/${CTAGS}.1${extension}" fi done } @@ -95,7 +91,7 @@ set_symlinks() { fi =20 # is the target valid, i.e. does a ctags binary with this name exist? - [[ -f ${EROOT}${bindir}/${target} ]] \ + [[ -f ${EROOT}/usr/bin/${target} ]] \ || die -q "Target \"$1\" doesn't appear to be valid!" =20 echo "Switching ${CTAGS} to ${target} ..." @@ -107,7 +103,7 @@ set_symlinks() { =20 test_for_root() { # checks if the user has rights to modify /usr/bin/ - [[ -w ${EROOT}${bindir} ]] || die -q "You need root privileges!" + [[ -w ${EROOT}/usr/bin ]] || die -q "You need root privileges!" } =20 ### show action ### @@ -120,11 +116,11 @@ do_show() { [[ $# -gt 0 ]] && die -q "Too many parameters" =20 write_list_start "Current target of ${CTAGS} symlink:" - if [[ -L ${EROOT}${bindir}/${CTAGS} && -e ${EROOT}${bindir}/${CTAGS} ]] + if [[ -L ${EROOT}/usr/bin/${CTAGS} && -e ${EROOT}/usr/bin/${CTAGS} ]] then write_kv_list_entry \ - "$(basename "$(readlink "${EROOT}${bindir}/${CTAGS}")")" "" - elif [[ -e ${EROOT}${bindir}/${CTAGS} ]]; then + "$(basename "$(readlink "${EROOT}/usr/bin/${CTAGS}")")" "" + elif [[ -e ${EROOT}/usr/bin/${CTAGS} ]]; then write_kv_list_entry \ "(not a symlink or target of symlink does not exist)" "" else @@ -147,7 +143,7 @@ do_list() { for (( i =3D 0; i < ${#targets[@]}; i++ )); do # Highlight the currently chosen version [[ ${targets[i]} =3D \ - $(basename "$(readlink "${EROOT}${bindir}/${CTAGS}")") ]] \ + $(basename "$(readlink "${EROOT}/usr/bin/${CTAGS}")") ]] \ && targets[i]=3D$(highlight_marker "${targets[i]}") done write_list_start "Available ${CTAGS} symlink targets:" @@ -173,9 +169,9 @@ do_set() { [[ $# -gt 1 ]] && die -q "Too many parameters" test_for_root =20 - if [[ -e ${EROOT}${bindir}/${CTAGS} && ! -L ${EROOT}${bindir}/${CTAGS} = ]] + if [[ -e ${EROOT}/usr/bin/${CTAGS} && ! -L ${EROOT}/usr/bin/${CTAGS} ]] then - die -q "${EROOT}${bindir}/${CTAGS} exists but is not a symlink" + die -q "${EROOT}/usr/bin/${CTAGS} exists but is not a symlink" fi =20 set_symlinks "$1" || die -q "Couldn't set a new symlink" @@ -198,18 +194,18 @@ do_update() { test_for_root =20 if ! [[ $1 =3D=3D *if*unset \ - && -L ${EROOT}${bindir}/${CTAGS} && -e ${EROOT}${bindir}/${CTAGS} ]] + && -L ${EROOT}/usr/bin/${CTAGS} && -e ${EROOT}/usr/bin/${CTAGS} ]] then local current=3D"" - if [[ -L ${EROOT}${bindir}/${CTAGS} ]]; then - current=3D$(basename "$(readlink "${EROOT}${bindir}/${CTAGS}")") - if [[ ! -e ${EROOT}${bindir}/${CTAGS} ]]; then + if [[ -L ${EROOT}/usr/bin/${CTAGS} ]]; then + current=3D$(basename "$(readlink "${EROOT}/usr/bin/${CTAGS}")") + if [[ ! -e ${EROOT}/usr/bin/${CTAGS} ]]; then # clean up dead symlinks remove_symlinks || die -q "Couldn't remove existing symlink" fi - elif [[ -e ${EROOT}${bindir}/${CTAGS} ]]; then + elif [[ -e ${EROOT}/usr/bin/${CTAGS} ]]; then if ! [[ ${CTAGS} =3D ctags && $(uname) =3D FreeBSD ]]; then - die -q "${EROOT}${bindir}/${CTAGS} exists but is not a symlink" + die -q "${EROOT}/usr/bin/${CTAGS} exists but is not a symlink" fi # On FreeBSD ctags is a real file, installed by freebsd-ubin current=3Dnolink diff --git a/emacs.eselect b/emacs.eselect index 21d604e..530b4bb 100644 --- a/emacs.eselect +++ b/emacs.eselect @@ -20,12 +20,7 @@ # do_update(): Set the target to the highest version available # (optionally: only if not set) =20 -bindir=3D/usr/bin -man1dir=3D/usr/share/man/man1 -infodir=3D/usr/share/info -envdir=3D/etc/env.d - -DESCRIPTION=3D"Manage ${bindir}/emacs version" +DESCRIPTION=3D"Manage /usr/bin/emacs version" MAINTAINER=3D"emacs@gentoo.org" SVN_DATE=3D'$Date$' VERSION=3D$(svn_date_to_version "${SVN_DATE}") @@ -37,32 +32,32 @@ MANPAGELIST=3D"emacs emacsclient ebrowse gfdl" find_targets() { # Return the list of available Emacs binaries local j - for j in "${EROOT}${bindir}"/emacs-[0-9]*; do + for j in "${EROOT}"/usr/bin/emacs-[0-9]*; do [[ -f ${j} ]] && basename ${j} done } =20 remove_infopath() { # When cleaning symlinks this takes care of the info documentation sett= ings - rm -f "${EROOT}${envdir}/50emacs" + rm -f "${EROOT}/etc/env.d/50emacs" } =20 # Define INFOPATH environment variable in env file set_infopath() { - [[ -d ${EROOT}${infodir}/$1 ]] || return 1 - echo "INFOPATH=3D${EPREFIX}${infodir}/$1" >"${EROOT}${envdir}/50emacs" + [[ -d ${EROOT}/usr/share/info/$1 ]] || return 1 + echo "INFOPATH=3D${EPREFIX}/usr/share/info/$1" >"${EROOT}/etc/env.d/50e= macs" } =20 remove_symlinks() { # Remove existing symlinks to binaries, man pages, # and the env file (own function) local f - rm -f "${EROOT}${bindir}/emacs" + rm -f "${EROOT}/usr/bin/emacs" for f in ${BINARYLIST}; do - rm -f "${EROOT}${bindir}/${f}" + rm -f "${EROOT}/usr/bin/${f}" done for f in ${MANPAGELIST}; do - rm -f "${EROOT}${man1dir}"/${f}.1* + rm -f "${EROOT}"/usr/share/man/man1/${f}.1* done remove_infopath } @@ -72,9 +67,9 @@ set_bin_symlinks() { local target=3D${1} f for f in ${BINARYLIST}; do # set symlink only if target binary actually exists - if [[ -f ${EROOT}${bindir}/${f}-${target} ]]; then - ln -s "${f}-${target}" "${EROOT}${bindir}/${f}" || die \ - "Couldn't set ${f}-${target} ${EROOT}${bindir}/${f} symlink" + if [[ -f ${EROOT}/usr/bin/${f}-${target} ]]; then + ln -s "${f}-${target}" "${EROOT}/usr/bin/${f}" || die \ + "Couldn't set ${f}-${target} ${EROOT}/usr/bin/${f} symlink" fi done } @@ -83,12 +78,12 @@ set_man_symlinks() { # Set symlinks to man pages local target=3D${1} extension f i for f in ${MANPAGELIST}; do - for i in "${EROOT}${man1dir}"/${f}-${target}.1*; do + for i in "${EROOT}"/usr/share/man/man1/${f}-${target}.1*; do if [[ -f ${i} ]]; then # target file exists; determine compress extension extension=3D${i##*/${f}-${target}.1} ln -s "${f}-${target}.1${extension}" \ - "${EROOT}${man1dir}/${f}.1${extension}" + "${EROOT}/usr/share/man/man1/${f}.1${extension}" fi done done @@ -107,7 +102,7 @@ set_symlinks() { fi =20 # is the target valid, i.e. does an Emacs binary with this name exist? - [[ -f ${EROOT}${bindir}/${target} ]] \ + [[ -f ${EROOT}/usr/bin/${target} ]] \ || die -q "Target \"${1}\" doesn't appear to be valid!" =20 echo "Switching emacs to ${target} ..." @@ -115,8 +110,8 @@ set_symlinks() { # the main /usr/bin/emacs symlink is only set for Emacs binaries # (but not for other providers of auxiliary programs, e.g., XEmacs) if [[ -z ${nomain} ]]; then - ln -s "${target}" "${EROOT}${bindir}/emacs" \ - || die "Couldn't set ${target} ${EROOT}${bindir}/emacs symlink" + ln -s "${target}" "${EROOT}/usr/bin/emacs" \ + || die "Couldn't set ${target} ${EROOT}/usr/bin/emacs symlink" fi set_bin_symlinks "${target}" set_man_symlinks "${target}" @@ -131,7 +126,7 @@ set_symlinks() { xemacs_info() { # This is just informational to tell that XEmacs has been found, # a wish from graaff - if [[ -e ${EROOT}${bindir}/xemacs ]]; then + if [[ -e ${EROOT}/usr/bin/xemacs ]]; then echo write_list_start "XEmacs is also installed" fi @@ -139,7 +134,7 @@ xemacs_info() { =20 vim_info() { # Don't take this too serious - if [[ -e ${EROOT}${bindir}/vi ]]; then + if [[ -e ${EROOT}/usr/bin/vi ]]; then echo write_list_start "Vi found, your system is in real trouble now! ;)" fi @@ -147,7 +142,7 @@ vim_info() { =20 test_for_root() { # checks if the user has rights to modify /usr/bin/ - [[ -w ${EROOT}${bindir} ]] || die -q "You need root privileges!" + [[ -w ${EROOT}/usr/bin ]] || die -q "You need root privileges!" } =20 ### show action ### @@ -160,10 +155,10 @@ do_show() { [[ $# -gt 0 ]] && die -q "Too many parameters" =20 write_list_start "Current target of Emacs symlink:" - if [[ -L ${EROOT}${bindir}/emacs && -e ${EROOT}${bindir}/emacs ]]; then + if [[ -L ${EROOT}/usr/bin/emacs && -e ${EROOT}/usr/bin/emacs ]]; then write_kv_list_entry \ - "$(basename "$(readlink "${EROOT}${bindir}/emacs")")" "" - elif [[ -e ${EROOT}${bindir}/emacs ]]; then + "$(basename "$(readlink "${EROOT}/usr/bin/emacs")")" "" + elif [[ -e ${EROOT}/usr/bin/emacs ]]; then write_kv_list_entry \ "(not a symlink or target of symlink does not exist)" "" else @@ -191,7 +186,7 @@ do_list() { for (( i =3D 0; i < ${#targets[@]}; i++ )); do # Highlight the currently chosen version [[ ${targets[i]} =3D \ - $(basename "$(readlink "${EROOT}${bindir}/emacs")") ]] \ + $(basename "$(readlink "${EROOT}/usr/bin/emacs")") ]] \ && targets[i]=3D$(highlight_marker "${targets[i]}") done write_list_start "Available Emacs symlink targets:" @@ -222,8 +217,8 @@ do_set() { [[ $# -gt 1 ]] && die -q "Too many parameters" test_for_root =20 - if [[ -e ${EROOT}${bindir}/emacs && ! -L ${EROOT}${bindir}/emacs ]]; th= en - die -q "${EROOT}${bindir}/emacs exists but is not a symlink" + if [[ -e ${EROOT}/usr/bin/emacs && ! -L ${EROOT}/usr/bin/emacs ]]; then + die -q "${EROOT}/usr/bin/emacs exists but is not a symlink" fi =20 set_symlinks "${1}" || die -q "Couldn't set a new symlink" @@ -247,23 +242,23 @@ do_update() { [[ $# -gt 1 ]] && die -q "Too many parameters" test_for_root =20 - if [[ -L ${EROOT}${bindir}/emacs ]]; then - if [[ $1 =3D=3D *if*unset && -e ${EROOT}${bindir}/emacs ]]; then + if [[ -L ${EROOT}/usr/bin/emacs ]]; then + if [[ $1 =3D=3D *if*unset && -e ${EROOT}/usr/bin/emacs ]]; then do_action ctags update ifunset return fi # this is not redundant: "update" is called in pkg_postrm() of emacs # and should clean up any dead symlinks if no valid target exists remove_symlinks || die -q "Couldn't remove existing symlink" - elif [[ -e ${EROOT}${bindir}/emacs ]]; then - die -q "${EROOT}${bindir}/emacs exists but is not a symlink" + elif [[ -e ${EROOT}/usr/bin/emacs ]]; then + die -q "${EROOT}/usr/bin/emacs exists but is not a symlink" fi =20 local targets=3D( $(find_targets) ) if [[ ${#targets[@]} -gt 0 ]]; then set_symlinks "${targets[${#targets[@]}-1]}" \ || die -q "Couldn't set a new symlink" - elif [[ -f ${EROOT}${bindir}/xemacs ]]; then + elif [[ -f ${EROOT}/usr/bin/xemacs ]]; then # no Emacs target found - link to XEmacs versions set_symlinks xemacs nomain fi