diff options
author | Ulrich Müller <ulm@gentoo.org> | 2009-05-11 16:42:01 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2009-05-11 16:42:01 +0000 |
commit | 1fe185f605174a2a97566792030277085afd8771 (patch) | |
tree | 984641446d164607401547f9cf6b71c4ff9505c0 | |
parent | OpenRC support is a new feature, not a bugfix; update NEWS file. (diff) | |
download | eselect-1fe185f605174a2a97566792030277085afd8771.tar.gz eselect-1fe185f605174a2a97566792030277085afd8771.tar.bz2 eselect-1fe185f605174a2a97566792030277085afd8771.zip |
Sync emacs and ctags modules from the Emacs SVN repository.
svn path=/trunk/; revision=533
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | man/ctags.eselect.5 | 12 | ||||
-rw-r--r-- | man/emacs.eselect.5 | 12 | ||||
-rw-r--r-- | modules/ctags.eselect | 126 | ||||
-rw-r--r-- | modules/emacs.eselect | 76 |
5 files changed, 130 insertions, 112 deletions
@@ -1,3 +1,10 @@ +2009-05-11 Ulrich Mueller <ulm@gentoo.org> + + * modules/emacs.eselect, modules/ctags.eselect: + * man/emacs.eselect.5, man/ctags.eselect.5: Sync the emacs and + ctags modules from the Emacs SVN repository (r1275), corresponding + to the eselect-emacs-1.10 release. + 2009-05-05 Ulrich Mueller <ulm@gentoo.org> * modules/news-tng.eselect (do_list): Display fallback values if @@ -254,11 +261,10 @@ 2008-03-24 Ulrich Mueller <ulm@gentoo.org> - * man/emacs.eselect.5, man/ctags.eselect.5: Ditto for man pages. - - * modules/emacs.eselect, modules/ctags.eselect: Import the - emacs and ctags modules from the Emacs SVN repository (r1030), - corresponding to the eselect-emacs-1.3 release. + * modules/emacs.eselect, modules/ctags.eselect: + * man/emacs.eselect.5, man/ctags.eselect.5: Import the emacs and + ctags modules from the Emacs SVN repository (r1030), corresponding + to the eselect-emacs-1.3 release. 2008-01-28 Piotr Jaroszyński <peper@gentoo.org> diff --git a/man/ctags.eselect.5 b/man/ctags.eselect.5 index 423a42d..0165343 100644 --- a/man/ctags.eselect.5 +++ b/man/ctags.eselect.5 @@ -1,14 +1,14 @@ -.\" Copyright 2007-2008 Gentoo Foundation +.\" Copyright 2007-2009 Gentoo Foundation .\" Distributed under the terms of the GNU General Public License v2 .\" $Id$ .\" -.TH ESELECT 5 "December 2008" "Gentoo Linux" eselect +.TH ctags.eselect 5 "May 2009" "Gentoo Linux" eselect .SH NAME ctags.eselect, etags.eselect \- The ctags and etags management module for Gentoo's eselect .SH SYNOPSIS .B eselect ctags -.RB [ help | usage ] +.RB [ help | usage | version ] .br .B eselect ctags list .br @@ -18,6 +18,7 @@ for Gentoo's eselect .B eselect ctags show .br .B eselect ctags update +.RB [ ifunset ] .SH DESCRIPTION .B eselect is Gentoo's configuration and management tool. It features modules @@ -66,10 +67,13 @@ Current target of symlink: exuberant-ctags .SH ACTION: UPDATE .B eselect ctags update +.RB [ ifunset ] .br Update the ctags symlink. For an update only the version is changed, but not the provider (i.e. Emacs vs Exuberant). At the moment only -(X)Emacs offers several concurrent versions. +(X)Emacs offers several concurrent versions. If option +.B ifunset +is given, an existing implementation is not overridden. # eselect ctags update .br diff --git a/man/emacs.eselect.5 b/man/emacs.eselect.5 index bb5f634..b242867 100644 --- a/man/emacs.eselect.5 +++ b/man/emacs.eselect.5 @@ -1,13 +1,13 @@ -.\" Copyright 2007-2008 Gentoo Foundation +.\" Copyright 2007-2009 Gentoo Foundation .\" Distributed under the terms of the GNU General Public License v2 .\" $Id$ .\" -.TH ESELECT 5 "December 2008" "Gentoo Linux" eselect +.TH emacs.eselect 5 "April 2009" "Gentoo Linux" eselect .SH NAME emacs.eselect \- The Emacs management module for Gentoo's eselect .SH SYNOPSIS .B eselect emacs -.RB [ help | usage ] +.RB [ help | usage | version ] .br .B eselect emacs list .br @@ -17,7 +17,7 @@ emacs.eselect \- The Emacs management module for Gentoo's eselect .B eselect emacs show .br .B eselect emacs update -.RI [ ifunset ] +.RB [ ifunset ] .SH DESCRIPTION .B eselect is Gentoo's configuration and management tool. It features modules @@ -67,10 +67,10 @@ Current target of GNU Emacs symlink: emacs-22 .SH ACTION: UPDATE .B eselect emacs update -.RI [ ifunset ] +.RB [ ifunset ] .br Update the emacs symlink to the last available version. If option -.I ifunset +.B ifunset is given, an existing implementation is not overridden. # eselect emacs update diff --git a/modules/ctags.eselect b/modules/ctags.eselect index 8f718f8..8980475 100644 --- a/modules/ctags.eselect +++ b/modules/ctags.eselect @@ -1,4 +1,4 @@ -# Copyright 2005-2008 Gentoo Foundation +# Copyright 2005-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ # @@ -39,13 +39,12 @@ 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 "${ROOT}${bindir}/emacs" && \ - -e $(canonicalise "${ROOT}${bindir}/emacs") ]]; then - emacs=$(basename $(readlink "${ROOT}${bindir}/emacs") ) - [[ -f "${ROOT}${bindir}/${CTAGS}-${emacs}" ]] && echo ${CTAGS}-${emacs} - elif [[ -f "${ROOT}${bindir}/xemacs" ]]; then - [[ -f "${ROOT}${bindir}/${CTAGS}-xemacs" ]] && echo ${CTAGS}-xemacs - elif [[ ${CTAGS} == etags ]]; then + if [[ -L ${ROOT}${bindir}/emacs && -e ${ROOT}${bindir}/emacs ]]; then + emacs=$(basename "$(readlink "${ROOT}${bindir}/emacs")") + [[ -f ${ROOT}${bindir}/${CTAGS}-${emacs} ]] && echo "${CTAGS}-${emacs}" + elif [[ -f ${ROOT}${bindir}/xemacs ]]; then + [[ -f ${ROOT}${bindir}/${CTAGS}-xemacs ]] && echo "${CTAGS}-xemacs" + elif [[ ${CTAGS} = 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 # exuberant-ctags as default for etags (for ctags it's fine). @@ -54,7 +53,7 @@ find_targets() { fi # Exuberant ctags - [[ -f "${ROOT}${bindir}/exuberant-ctags" ]] && echo exuberant-ctags + [[ -f ${ROOT}${bindir}/exuberant-ctags ]] && echo exuberant-ctags } remove_symlinks() { @@ -85,19 +84,19 @@ set_man_symlinks() { set_symlinks() { # Set symlinks to binary and man page - local target="${1}" targets + local target=$1 targets # target may be specified by its name or its index if is_number "${target}"; then # numeric index, find the target's name targets=( $(find_targets) ) [[ ${target} -ge 1 && ${target} -le ${#targets[@]} ]] \ || die -q "Number out of range: ${1}" - target=${targets[$(( ${target} - 1 ))]} + target=${targets[target-1]} fi # is the target valid, i.e. does a ctags binary with this name exist? - [[ -f "${ROOT}${bindir}/${target}" ]] \ - || die -q "Target \"${1}\" doesn't appear to be valid!" + [[ -f ${ROOT}${bindir}/${target} ]] \ + || die -q "Target \"$1\" doesn't appear to be valid!" echo "Switching ${CTAGS} to ${target} ..." remove_symlinks || die -q "Couldn't remove existing symlink" @@ -108,7 +107,7 @@ set_symlinks() { test_for_root() { # checks if the user has rights to modify /usr/bin/ - [[ -w "${ROOT}${bindir}" ]] || die -q "You need root privileges!" + [[ -w ${ROOT}${bindir} ]] || die -q "You need root privileges!" } ### show action ### @@ -118,14 +117,14 @@ describe_show() { } do_show() { - [[ ${#@} -gt 0 ]] && die -q "Too many parameters" + [[ $# -gt 0 ]] && die -q "Too many parameters" write_list_start "Current target of ${CTAGS} symlink:" - if [[ -L "${ROOT}${bindir}/${CTAGS}" && \ - -e $(canonicalise "${ROOT}${bindir}/${CTAGS}") ]]; then + if [[ -L ${ROOT}${bindir}/${CTAGS} && -e ${ROOT}${bindir}/${CTAGS} ]] + then write_kv_list_entry \ - $(basename $(readlink "${ROOT}${bindir}/${CTAGS}") ) "" - elif [[ -e "${ROOT}${bindir}/${CTAGS}" ]]; then + "$(basename "$(readlink "${ROOT}${bindir}/${CTAGS}")")" "" + elif [[ -e ${ROOT}${bindir}/${CTAGS} ]]; then write_kv_list_entry \ "(not a symlink or target of symlink does not exist)" "" else @@ -140,19 +139,19 @@ describe_list() { } do_list() { - [[ ${#@} -gt 0 ]] && die -q "Too many parameters" + [[ $# -gt 0 ]] && die -q "Too many parameters" local i targets targets=( $(find_targets) ) + write_list_start "Available ${CTAGS} symlink targets:" if [[ -n ${targets[@]} ]]; then - for (( i = 0; i < ${#targets[@]}; i = i + 1 )); do + for (( i = 0; i < ${#targets[@]}; i++ )); do # Display a star to indicate the currently chosen version - [[ ${targets[${i}]} = \ - $(basename $(readlink "${ROOT}${bindir}/${CTAGS}") ) ]] \ - && targets[${i}]="${targets[${i}]} $(highlight '*')" + [[ ${targets[i]} = \ + $(basename "$(readlink "${ROOT}${bindir}/${CTAGS}")") ]] \ + && targets[i]="${targets[i]} $(highlight '*')" done - write_list_start "Available ${CTAGS} symlink targets:" write_numbered_list "${targets[@]}" else write_kv_list_entry "(none found)" "" @@ -174,16 +173,16 @@ describe_set_parameters() { } do_set() { - [[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink to" - [[ ${#@} -gt 1 ]] && die -q "Too many parameters" + [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to" + [[ $# -gt 1 ]] && die -q "Too many parameters" test_for_root - if [[ -e "${ROOT}${bindir}/${CTAGS}" && ! -L "${ROOT}${bindir}/${CTAGS}" ]] + if [[ -e ${ROOT}${bindir}/${CTAGS} && ! -L ${ROOT}${bindir}/${CTAGS} ]] then die -q "${ROOT}${bindir}/${CTAGS} exists but is not a symlink" fi - set_symlinks "${1}" || die -q "Couldn't set a new symlink" + set_symlinks "$1" || die -q "Couldn't set a new symlink" } ### update action ### @@ -192,44 +191,53 @@ describe_update() { echo "Automatically update the ${CTAGS} symlink" } +describe_update_options() { + echo "ifunset : Do not override currently set version" +} + do_update() { - [[ -z "${1}" || "${1}" == norecursion ]] || die -q "Usage error" - [[ ${#@} -gt 1 ]] && die -q "Too many parameters" + [[ -z $1 || $1 = ifunset || $1 = --if-unset ]] || die -q "Usage error" + [[ -z $2 || $2 = norecursion ]] || die -q "Usage error" + [[ $# -gt 2 ]] && die -q "Too many parameters" test_for_root - local current="" - if [[ -L "${ROOT}${bindir}/${CTAGS}" ]]; then - current=$(basename $(readlink "${ROOT}${bindir}/${CTAGS}") ) - if [[ ! -e $(canonicalise "${ROOT}${bindir}/${CTAGS}") ]]; then - # clean up dead symlinks - remove_symlinks || die -q "Couldn't remove existing symlink" - fi - elif [[ -e "${ROOT}${bindir}/${CTAGS}" ]]; then - if ! [[ ${CTAGS} == ctags && $(uname) == FreeBSD ]]; then - die -q "${ROOT}${bindir}/${CTAGS} exists but is not a symlink" + if ! [[ $1 == *if*unset \ + && -L ${ROOT}${bindir}/${CTAGS} && -e ${ROOT}${bindir}/${CTAGS} ]] + then + local current="" + if [[ -L ${ROOT}${bindir}/${CTAGS} ]]; then + current=$(basename "$(readlink "${ROOT}${bindir}/${CTAGS}")") + if [[ ! -e ${ROOT}${bindir}/${CTAGS} ]]; then + # clean up dead symlinks + remove_symlinks || die -q "Couldn't remove existing symlink" + fi + elif [[ -e ${ROOT}${bindir}/${CTAGS} ]]; then + if ! [[ ${CTAGS} = ctags && $(uname) = FreeBSD ]]; then + die -q "${ROOT}${bindir}/${CTAGS} exists but is not a symlink" + fi + # On FreeBSD ctags is a real file, installed by freebsd-ubin + current=nolink fi - # On FreeBSD ctags is a real file, installed by freebsd-ubin - current=nolink - fi - - # For an "update" only the version should be changed, but not the - # provider (i.e. Emacs vs Exuberant). At the moment only (X)Emacs - # offers several concurrent versions. - local i target targets=( $(find_targets) ) - if [[ ${#targets[@]} -gt 0 && ${current} != nolink ]]; then - target=${targets[0]} - [[ "${current}" == ${CTAGS}-*emacs* ]] && current="${CTAGS}-*emacs*" - for i in ${targets[@]}; do - [[ "${i}" == "${current}" ]] && target="${i}" - done - set_symlinks "${target}" || die -q "Couldn't set a new symlink" + # For an "update" only the version should be changed, but not the + # provider (i.e. Emacs vs Exuberant). At the moment only (X)Emacs + # offers several concurrent versions. + + local i target targets=( $(find_targets) ) + if [[ ${#targets[@]} -gt 0 && ${current} != nolink ]]; then + target=${targets[0]} + [[ ${current} == ${CTAGS}-*emacs* ]] && current=${CTAGS}-*emacs* + for i in ${targets[@]}; do + [[ ${i} == ${current} ]] && target=${i} + done + set_symlinks "${target}" || die -q "Couldn't set a new symlink" + fi fi # Call "eselect etags update" from the ctags module and vice versa - [[ "${1}" == norecursion ]] && return + [[ $2 = norecursion ]] && return case ${CTAGS} in - ctags) CTAGS=etags do_update norecursion ;; - etags) CTAGS=ctags do_update norecursion ;; + ctags) CTAGS=etags do_update "$1" norecursion ;; + etags) CTAGS=ctags do_update "$1" norecursion ;; esac } diff --git a/modules/emacs.eselect b/modules/emacs.eselect index e780048..9b15d58 100644 --- a/modules/emacs.eselect +++ b/modules/emacs.eselect @@ -1,4 +1,4 @@ -# Copyright 2005-2008 Gentoo Foundation +# Copyright 2005-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ # @@ -49,8 +49,8 @@ remove_infopath() { # Define INFOPATH environment variable in env file set_infopath() { - [[ -d "${ROOT}${infodir}/${1}" ]] || return 1 - echo "INFOPATH=${infodir}/${1}" > "${ROOT}${envdir}/50emacs" + [[ -d ${ROOT}${infodir}/$1 ]] || return 1 + echo "INFOPATH=${infodir}/$1" > "${ROOT}${envdir}/50emacs" } remove_symlinks() { @@ -72,9 +72,9 @@ set_bin_symlinks() { local target=${1} f for f in ${BINARYLIST}; do # set symlink only if target binary actually exists - if [[ -f "${ROOT}${bindir}/${f}-${target}" ]]; then - ln -s "${f}-${target}" "${ROOT}${bindir}/${f}" || - die "Couldn't set ${f}-${target} ${ROOT}${bindir}/${f} symlink" + if [[ -f ${ROOT}${bindir}/${f}-${target} ]]; then + ln -s "${f}-${target}" "${ROOT}${bindir}/${f}" || die \ + "Couldn't set ${f}-${target} ${ROOT}${bindir}/${f} symlink" fi done } @@ -96,18 +96,18 @@ set_man_symlinks() { set_symlinks() { # Set symlinks to binaries and man pages, update info path - local target="${1}" nomain="${2}" targets + local target=$1 nomain=$2 targets # target may be specified by its name or its index if is_number "${target}"; then # numeric index, find the target's name targets=( $(find_targets) ) [[ ${target} -ge 1 && ${target} -le ${#targets[@]} ]] \ || die -q "Number out of range: ${1}" - target=${targets[$(( ${target} - 1 ))]} + target=${targets[target-1]} fi # is the target valid, i.e. does an Emacs binary with this name exist? - [[ -f "${ROOT}${bindir}/${target}" ]] \ + [[ -f ${ROOT}${bindir}/${target} ]] \ || die -q "Target \"${1}\" doesn't appear to be valid!" echo "Switching emacs to ${target} ..." @@ -132,7 +132,7 @@ set_symlinks() { xemacs_info() { # This is just informational to tell that XEmacs has been found, # a wish from graaff - if [[ -e "${ROOT}${bindir}/xemacs" ]]; then + if [[ -e ${ROOT}${bindir}/xemacs ]]; then echo write_list_start "XEmacs is also installed" fi @@ -140,7 +140,7 @@ xemacs_info() { vim_info() { # Don't take this too serious - if [[ -e "${ROOT}${bindir}/vi" ]]; then + if [[ -e ${ROOT}${bindir}/vi ]]; then echo write_list_start "Vi found, your system is in real trouble now! ;)" fi @@ -148,7 +148,7 @@ vim_info() { test_for_root() { # checks if the user has rights to modify /usr/bin/ - [[ -w "${ROOT}${bindir}" ]] || die -q "You need root privileges!" + [[ -w ${ROOT}${bindir} ]] || die -q "You need root privileges!" } ### show action ### @@ -158,14 +158,13 @@ describe_show() { } do_show() { - [[ ${#@} -gt 0 ]] && die -q "Too many parameters" + [[ $# -gt 0 ]] && die -q "Too many parameters" write_list_start "Current target of Emacs symlink:" - if [[ -L "${ROOT}${bindir}/emacs" && \ - -e $(canonicalise "${ROOT}${bindir}/emacs") ]]; then + if [[ -L ${ROOT}${bindir}/emacs && -e ${ROOT}${bindir}/emacs ]]; then write_kv_list_entry \ - $(basename $(readlink "${ROOT}${bindir}/emacs") ) "" - elif [[ -e "${ROOT}${bindir}/emacs" ]]; then + "$(basename "$(readlink "${ROOT}${bindir}/emacs")")" "" + elif [[ -e ${ROOT}${bindir}/emacs ]]; then write_kv_list_entry \ "(not a symlink or target of symlink does not exist)" "" else @@ -182,19 +181,19 @@ describe_list() { } do_list() { - [[ ${#@} -gt 0 ]] && die -q "Too many parameters" + [[ $# -gt 0 ]] && die -q "Too many parameters" local i targets targets=( $(find_targets) ) + write_list_start "Available Emacs symlink targets:" if [[ -n ${targets[@]} ]]; then - for (( i = 0; i < ${#targets[@]}; i = i + 1 )); do + for (( i = 0; i < ${#targets[@]}; i++ )); do # Display a star to indicate the currently chosen version - [[ ${targets[${i}]} = \ - $(basename $(readlink "${ROOT}${bindir}/emacs") ) ]] \ - && targets[${i}]="${targets[${i}]} $(highlight '*')" + [[ ${targets[i]} = \ + $(basename "$(readlink "${ROOT}${bindir}/emacs")") ]] \ + && targets[i]="${targets[i]} $(highlight '*')" done - write_list_start "Available Emacs symlink targets:" write_numbered_list "${targets[@]}" else write_kv_list_entry "(none found)" "" @@ -218,11 +217,11 @@ describe_set_parameters() { } do_set() { - [[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink to" - [[ ${#@} -gt 1 ]] && die -q "Too many parameters" + [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to" + [[ $# -gt 1 ]] && die -q "Too many parameters" test_for_root - if [[ -e "${ROOT}${bindir}/emacs" && ! -L "${ROOT}${bindir}/emacs" ]]; then + if [[ -e ${ROOT}${bindir}/emacs && ! -L ${ROOT}${bindir}/emacs ]]; then die -q "${ROOT}${bindir}/emacs exists but is not a symlink" fi @@ -243,30 +242,31 @@ describe_update_options() { } do_update() { - [[ -z "${1}" || "${1}" == "ifunset" || "${1}" == "--if-unset" ]] \ - || die -q "Usage error" - [[ ${#@} -gt 1 ]] && die -q "Too many parameters" + [[ -z $1 || $1 = ifunset || $1 = --if-unset ]] || die -q "Usage error" + [[ $# -gt 1 ]] && die -q "Too many parameters" test_for_root - if [[ -L "${ROOT}${bindir}/emacs" ]]; then - [[ ${1} == *if*unset \ - && -e $(canonicalise "${ROOT}${bindir}/emacs") ]] \ - && return + if [[ -L ${ROOT}${bindir}/emacs ]]; then + if [[ $1 == *if*unset && -e ${ROOT}${bindir}/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 "${ROOT}${bindir}/emacs" ]]; then + elif [[ -e ${ROOT}${bindir}/emacs ]]; then die -q "${ROOT}${bindir}/emacs exists but is not a symlink" fi local targets=( $(find_targets) ) if [[ ${#targets[@]} -gt 0 ]]; then - set_symlinks ${#targets[@]} || die -q "Couldn't set a new symlink" - elif [[ -f "${ROOT}${bindir}/xemacs" ]]; then - # no Emacs target found -- link ctags, etags etc. to XEmacs versions + set_symlinks "${targets[${#targets[@]}-1]}" \ + || die -q "Couldn't set a new symlink" + elif [[ -f ${ROOT}${bindir}/xemacs ]]; then + # no Emacs target found - link to XEmacs versions set_symlinks xemacs nomain fi - # ctags symlinks are handled in an own module now + # ctags and etags symlinks are handled in an own module do_action ctags update } |