summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2008-04-30 10:54:10 +0000
committerUlrich Müller <ulm@gentoo.org>2008-04-30 10:54:10 +0000
commitda5e28ad5262198e63323f37944a0e1509d263c1 (patch)
tree8514357bcc33e612f8743627c4ceeeffd7fd9630
parentAdd copyright notices. (diff)
downloademacs-tools-da5e28ad5262198e63323f37944a0e1509d263c1.tar.gz
emacs-tools-da5e28ad5262198e63323f37944a0e1509d263c1.tar.bz2
emacs-tools-da5e28ad5262198e63323f37944a0e1509d263c1.zip
New eselect module for etags.
svn path=/eselect-emacs/; revision=1040
-rw-r--r--ChangeLog10
-rw-r--r--Makefile4
-rw-r--r--ctags.eselect68
-rw-r--r--ctags.eselect.517
-rw-r--r--emacs.eselect19
-rw-r--r--emacs.eselect.516
-rw-r--r--etags.eselect2
-rw-r--r--etags.eselect.51
8 files changed, 86 insertions, 51 deletions
diff --git a/ChangeLog b/ChangeLog
index e6d17ba..01adc0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-30 Ulrich Mueller <ulm@gentoo.org>
+
+ * ctags.eselect: Generalise for both ctags and etags,
+ suggestion by Hans de Graaff.
+ * etags.eselect: New file, sources ctags.eselect.
+ * emacs.eselect (do_set, do_update): Call etags module.
+ * ctags.eselect.5, emacs.eselect.5: Update man pages.
+ * etags.eselect.5: New file, sources ctags.eselect.5.
+ * Makefile (DISTFILES): Add new files.
+
2007-11-20 Ulrich Mueller <ulm@gentoo.org>
* version 1.3
diff --git a/Makefile b/Makefile
index fa95d85..d8cb6b1 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,8 @@ PV = $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*\([^ \t]*\).*/\1/;q' \
ChangeLog)
P = $(PN)-$(PV)
-DISTFILES = emacs.eselect ctags.eselect \
- emacs.eselect.5 ctags.eselect.5 ChangeLog
+DISTFILES = emacs.eselect ctags.eselect etags.eselect \
+ emacs.eselect.5 ctags.eselect.5 etags.eselect.5 ChangeLog
.PHONY: all dist clean
diff --git a/ctags.eselect b/ctags.eselect
index 8b82554..1370e94 100644
--- a/ctags.eselect
+++ b/ctags.eselect
@@ -1,4 +1,4 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
@@ -19,7 +19,10 @@
# do_set(): Set a version to be target of the symlink.
# do_update(): Set the target to the "best" available version. See below.
-DESCRIPTION="Manage /usr/bin/ctags implementations"
+# This module is used for ctags and etags
+CTAGS=${CTAGS:-ctags}
+
+DESCRIPTION="Manage /usr/bin/${CTAGS} implementations"
MAINTAINER="emacs@gentoo.org"
SVN_DATE='$Date$'
VERSION=$(svn_date_to_version "${SVN_DATE}" )
@@ -34,9 +37,9 @@ find_targets() {
if [[ -L "${ROOT}/usr/bin/emacs" && \
-e $(canonicalise "${ROOT}/usr/bin/emacs") ]]; then
emacs=$(basename $(canonicalise "${ROOT}/usr/bin/emacs") )
- [[ -f "${ROOT}/usr/bin/ctags-${emacs}" ]] && echo "ctags-${emacs}"
+ [[ -f "${ROOT}/usr/bin/${CTAGS}-${emacs}" ]] && echo ${CTAGS}-${emacs}
elif [[ -f "${ROOT}/usr/bin/xemacs" ]]; then
- [[ -f "${ROOT}/usr/bin/ctags-xemacs" ]] && echo ctags-xemacs
+ [[ -f "${ROOT}/usr/bin/${CTAGS}-xemacs" ]] && echo ${CTAGS}-xemacs
fi
# Exuberant ctags
@@ -45,15 +48,15 @@ find_targets() {
remove_symlinks() {
# Remove existing symlinks to binary and man page
- rm -f "${ROOT}"/usr/bin/ctags
- rm -f "${ROOT}"/usr/share/man/man1/ctags.1*
+ rm -f "${ROOT}"/usr/bin/${CTAGS}
+ rm -f "${ROOT}"/usr/share/man/man1/${CTAGS}.1*
}
set_bin_symlinks() {
# Set symlink to binary
local target=${1}
- ln -s "${target}" "${ROOT}/usr/bin/ctags" \
- || die "Couldn't set ${target} ${ROOT}/usr/bin/ctags symlink"
+ ln -s "${target}" "${ROOT}/usr/bin/${CTAGS}" \
+ || die "Couldn't set ${target} ${ROOT}/usr/bin/${CTAGS} symlink"
}
set_man_symlinks() {
@@ -64,7 +67,7 @@ set_man_symlinks() {
# target file exists; determine compress extension
extension=${i##*/${target}.1}
ln -s "${target}.1${extension}" \
- "${ROOT}/usr/share/man/man1/ctags.1${extension}"
+ "${ROOT}/usr/share/man/man1/${CTAGS}.1${extension}"
fi
done
}
@@ -85,7 +88,7 @@ set_symlinks() {
[[ -f "${ROOT}/usr/bin/${target}" ]] \
|| die -q "Target \"${1}\" doesn't appear to be valid!"
- echo "Switching to ${target} ..."
+ echo "Switching ${CTAGS} to ${target} ..."
remove_symlinks || die -q "Couldn't remove existing symlink"
set_bin_symlinks "${target}"
set_man_symlinks "${target}"
@@ -100,18 +103,18 @@ test_for_root() {
### show action ###
describe_show() {
- echo "Show the current target of the ctags symlink"
+ echo "Show the current target of the ${CTAGS} symlink"
}
do_show() {
[[ ${#@} -gt 0 ]] && die -q "Too many parameters"
- write_list_start "Current target of ctags symlink:"
- if [[ -L "${ROOT}/usr/bin/ctags" && \
- -e $(canonicalise "${ROOT}/usr/bin/ctags") ]]; then
+ write_list_start "Current target of ${CTAGS} symlink:"
+ if [[ -L "${ROOT}/usr/bin/${CTAGS}" && \
+ -e $(canonicalise "${ROOT}/usr/bin/${CTAGS}") ]]; then
write_kv_list_entry \
- $(basename $(canonicalise "${ROOT}/usr/bin/ctags") ) ""
- elif [[ -e "${ROOT}/usr/bin/ctags" ]]; then
+ $(basename $(canonicalise "${ROOT}/usr/bin/${CTAGS}") ) ""
+ elif [[ -e "${ROOT}/usr/bin/${CTAGS}" ]]; then
write_kv_list_entry \
"(not a symlink or target of symlink does not exist)" ""
else
@@ -122,7 +125,7 @@ do_show() {
### list action ###
describe_list() {
- echo "List available ctags symlink targets"
+ echo "List available ${CTAGS} symlink targets"
}
do_list() {
@@ -135,10 +138,10 @@ do_list() {
for (( i = 0; i < ${#targets[@]}; i = i + 1 )); do
# Display a star to indicate the currently chosen version
[[ ${targets[${i}]} = \
- $(basename $(canonicalise "${ROOT}/usr/bin/ctags") ) ]] \
+ $(basename $(canonicalise "${ROOT}/usr/bin/${CTAGS}") ) ]] \
&& targets[${i}]="${targets[${i}]} $(highlight '*')"
done
- write_list_start "Available ctags symlink targets:"
+ write_list_start "Available ${CTAGS} symlink targets:"
write_numbered_list "${targets[@]}"
else
write_kv_list_entry "(none found)" ""
@@ -148,7 +151,7 @@ do_list() {
### set action ###
describe_set() {
- echo "Set a new ctags symlink"
+ echo "Set a new ${CTAGS} symlink"
}
describe_set_options() {
@@ -164,13 +167,15 @@ do_set() {
[[ ${#@} -gt 1 ]] && die -q "Too many parameters"
test_for_root
- if [[ -e "${ROOT}/usr/bin/ctags" && ! -L "${ROOT}/usr/bin/ctags" ]]; then
- if [[ -f "${ROOT}/usr/bin/ctags" && $(uname) == FreeBSD ]]; then
+ if [[ -e "${ROOT}/usr/bin/${CTAGS}" && ! -L "${ROOT}/usr/bin/${CTAGS}" ]]
+ then
+ if [[ ${CTAGS} == ctags && -f "${ROOT}/usr/bin/ctags" \
+ && $(uname) == FreeBSD ]]; then
# On FreeBSD ctags is a real file, installed by freebsd-ubin
echo "${ROOT}/usr/bin/ctags is a real file - no action"
return
fi
- die -q "Sorry, ${ROOT}/usr/bin/ctags exists but is not a symlink"
+ die -q "Sorry, ${ROOT}/usr/bin/${CTAGS} exists but is not a symlink"
fi
set_symlinks "${1}" || die -q "Couldn't set a new symlink"
@@ -179,7 +184,7 @@ do_set() {
### update action ###
describe_update() {
- echo "Automatically update the ctags symlink"
+ echo "Automatically update the ${CTAGS} symlink"
}
do_update() {
@@ -187,18 +192,19 @@ do_update() {
test_for_root
local ctags=""
- if [[ -L "${ROOT}/usr/bin/ctags" ]]; then
- ctags=$(basename $(canonicalise "${ROOT}/usr/bin/ctags") )
- if [[ ! -e $(canonicalise "${ROOT}/usr/bin/ctags") ]]; then
+ if [[ -L "${ROOT}/usr/bin/${CTAGS}" ]]; then
+ ctags=$(basename $(canonicalise "${ROOT}/usr/bin/${CTAGS}") )
+ if [[ ! -e $(canonicalise "${ROOT}/usr/bin/${CTAGS}") ]]; then
# clean up dead symlinks
remove_symlinks || die -q "Couldn't remove existing symlink"
fi
- elif [[ -e "${ROOT}/usr/bin/ctags" ]]; then
- if [[ -f "${ROOT}/usr/bin/ctags" && $(uname) == FreeBSD ]]; then
+ elif [[ -e "${ROOT}/usr/bin/${CTAGS}" ]]; then
+ if [[ ${CTAGS} == ctags \
+ && -f "${ROOT}/usr/bin/ctags" && $(uname) == FreeBSD ]]; then
# On FreeBSD ctags is a real file, installed by freebsd-ubin
return
fi
- die -q "Sorry, ${ROOT}/usr/bin/ctags exists but is not a symlink"
+ die -q "Sorry, ${ROOT}/usr/bin/${CTAGS} exists but is not a symlink"
fi
# For an "update" only the version should be changed, but not the
@@ -208,7 +214,7 @@ do_update() {
local i target targets=( $(find_targets) )
if [[ ${#targets[@]} -gt 0 ]]; then
target=${targets[0]}
- [[ "${ctags}" == ctags-*emacs* ]] && ctags="ctags-*emacs*"
+ [[ "${ctags}" == ${CTAGS}-*emacs* ]] && ctags="${CTAGS}-*emacs*"
for i in ${targets[@]}; do
[[ "${i}" == "${ctags}" ]] && target="${i}"
done
diff --git a/ctags.eselect.5 b/ctags.eselect.5
index f0972d3..c5fa2aa 100644
--- a/ctags.eselect.5
+++ b/ctags.eselect.5
@@ -1,10 +1,11 @@
-.\" Copyright 1999-2007 Gentoo Foundation
+.\" Copyright 1999-2008 Gentoo Foundation
.\" Distributed under the terms of the GNU General Public License v2
.\" $Id$
.\"
-.TH "ESELECT" "5" "August 2007" "Gentoo Linux" "eselect"
+.TH "ESELECT" "5" "April 2008" "Gentoo Linux" "eselect"
.SH "NAME"
-ctags.eselect \- The ctags management module for Gentoo's eselect
+ctags.eselect, etags.eselect \- The ctags and etags management module
+for Gentoo's eselect
.SH "SYNOPSIS"
\fBeselect ctags\fR [\fBhelp\fR|\fBusage\fR]
.br
@@ -18,6 +19,9 @@ ctags.eselect \- The ctags management module for Gentoo's eselect
.SH "DESCRIPTION"
\fBeselect\fR is Gentoo's configuration and management tool. It features
modules that care for the individual administrative tasks.
+
+The \fBctags\fR and \fBetags\fR eselect modules share a common syntax,
+therefore this man page collectively refers to them as \fBctags\fR.
.SH "ACTION: LIST"
\fBeselect ctags list\fR
.br
@@ -38,7 +42,7 @@ one installed version.
# eselect ctags set 2
.br
-Switching to exuberant-ctags ...
+Switching ctags to exuberant-ctags ...
.SH "ACTION: SHOW"
\fBeselect ctags show\fR
.br
@@ -58,10 +62,11 @@ but not the provider (i.e. Emacs vs Exuberant). At the moment only
# eselect ctags update
.br
-Switching to exuberant-ctags ...
+Switching ctags to exuberant-ctags ...
.SH "BUGS"
Under FreeBSD, \fBeselect ctags\fR does not work since \fBctags\fR is
-a real binary (owned by package freebsd-ubin).
+a real binary (owned by package freebsd-ubin). \fBeselect etags\fR
+does work though.
.SH "AUTHOR"
Ulrich Mueller <ulm@gentoo.org>
.SH "SEE ALSO"
diff --git a/emacs.eselect b/emacs.eselect
index 96d4aff..b4407fd 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -25,9 +25,10 @@ MAINTAINER="emacs@gentoo.org"
SVN_DATE='$Date$'
VERSION=$(svn_date_to_version "${SVN_DATE}" )
-# ctags is handled in an own module now
-BINARYLIST="emacsclient etags b2m ebrowse rcs-checkin grep-changelog"
-MANPAGELIST="emacs emacsclient etags gfdl"
+BINARYLIST="emacsclient b2m ebrowse rcs-checkin grep-changelog"
+MANPAGELIST="emacs emacsclient gfdl"
+# etags and ctags are handled in their own module
+EXTMODULELIST="etags ctags"
find_targets() {
# Return the list of available Emacs binaries
@@ -105,7 +106,7 @@ set_symlinks() {
[[ -f "${ROOT}/usr/bin/${target}" ]] \
|| die -q "Target \"${1}\" doesn't appear to be valid!"
- echo "Switching to ${target} ..."
+ echo "Switching emacs to ${target} ..."
remove_symlinks || die -q "Couldn't remove existing symlink"
# the main /usr/bin/emacs symlink is only set for Emacs binaries
# (but not for other providers of auxiliary programs, e.g., XEmacs)
@@ -224,7 +225,10 @@ do_set() {
set_symlinks "${1}" || die -q "Couldn't set a new symlink"
# ctags symlinks are handled in an own module now
- do_action ctags update
+ local m
+ for m in ${EXTMODULELIST}; do
+ do_action ${m} update
+ done
}
### update action ###
@@ -262,5 +266,8 @@ do_update() {
fi
# ctags symlinks are handled in an own module now
- do_action ctags update
+ local m
+ for m in ${EXTMODULELIST}; do
+ do_action ${m} update
+ done
}
diff --git a/emacs.eselect.5 b/emacs.eselect.5
index 4bf664e..c1b3f20 100644
--- a/emacs.eselect.5
+++ b/emacs.eselect.5
@@ -1,8 +1,8 @@
-.\" Copyright 1999-2007 Gentoo Foundation
+.\" Copyright 1999-2008 Gentoo Foundation
.\" Distributed under the terms of the GNU General Public License v2
.\" $Id$
.\"
-.TH "ESELECT" "5" "August 2007" "Gentoo Linux" "eselect"
+.TH "ESELECT" "5" "April 2008" "Gentoo Linux" "eselect"
.SH "NAME"
emacs.eselect \- The Emacs management module for Gentoo's eselect
.SH "SYNOPSIS"
@@ -40,9 +40,11 @@ one installed version.
# eselect emacs set 3
.br
-Switching to emacs-22 ...
+Switching emacs to emacs-22 ...
.br
-Switching to ctags-emacs-22 ...
+Switching etags to etags-emacs-22 ...
+.br
+Switching ctags to ctags-emacs-22 ...
.SH "ACTION: SHOW"
\fBeselect emacs show\fR
.br
@@ -62,9 +64,11 @@ overridden.
# eselect emacs update
.br
-Switching to emacs-22 ...
+Switching emacs to emacs-22 ...
+.br
+Switching etags to etags-emacs-22 ...
.br
-Switching to ctags-emacs-22 ...
+Switching ctags to ctags-emacs-22 ...
.SH "AUTHORS"
Christian Faulhammer <opfer@gentoo.org>
diff --git a/etags.eselect b/etags.eselect
new file mode 100644
index 0000000..1820133
--- /dev/null
+++ b/etags.eselect
@@ -0,0 +1,2 @@
+CTAGS=etags
+source ./ctags.eselect
diff --git a/etags.eselect.5 b/etags.eselect.5
new file mode 100644
index 0000000..826c281
--- /dev/null
+++ b/etags.eselect.5
@@ -0,0 +1 @@
+.so man5/ctags.eselect.5