public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     19df160be00cfc24ae71e2a7100062b5b6110b47
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May 24 19:19:47 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu May 24 19:19:47 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=19df160b

Add two GNUs to emphasise GNU Emacs vs XEmacs.

svn path=/emacs-extra/eselect-emacs/; revision=331

---
 emacs.eselect |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index 54709ca..7adf8ff 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -139,7 +139,7 @@ describe_show() {
 do_show() {
 	[[ -z "${@}" ]] || die -q "Too many parameters"
 
-	write_list_start "Current target of symlink:"
+	write_list_start "Current target of GNU Emacs symlink:"
 	if [[ -L "${ROOT}/usr/bin/emacs" && \
 		  -e $(canonicalise "${ROOT}/usr/bin/emacs") ]]; then
 		write_kv_list_entry \
@@ -172,7 +172,7 @@ do_list() {
 				# Display a star to indicate the currently chosen version
 				targets[${i}]="${targets[${i}]} $(highlight '*')"
 		done
-		write_list_start "Available Emacs symlink targets:"
+		write_list_start "Available GNU Emacs symlink targets:"
 		write_numbered_list "${targets[@]}"
 	else
 		write_kv_list_entry "(none found)" ""



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     e62b9220f0a5a4d5bdc59b01a057dfe81c517c37
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May 24 19:15:00 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu May 24 19:15:00 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=e62b9220

Honour ROOT and use write_list_start in xemacs_info. ChangeLog emacsified and in reverse chronological order.

svn path=/emacs-extra/eselect-emacs/; revision=330

---
 ChangeLog     |  118 +++++++++++++++++++++++++++-----------------------------
 emacs.eselect |    8 ++-
 2 files changed, 62 insertions(+), 64 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5525fdc..adf8c8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-05-24  Ulrich Mueller  <ulm@gentoo.org>
 
+	* emacs.eselect (xemacs_info): Use write_list_start function.
+	Honour ${ROOT}.
+
 	* Makefile (PV): Extract version from new ChangeLog format.
 
 2007-05-24  Christian Faulhammer  <opfer@gentoo.org>
@@ -21,7 +24,7 @@
 
 2007-04-16  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Updated e-mail address in man page.
+	* emacs.eselect.5: Updated e-mail address in man page.
 
 2007-04-04  Ulrich Mueller  <ulm@gentoo.org>
 
@@ -29,74 +32,72 @@
 
 2007-04-01  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Check for range of array in set_symlinks().
-
-	* Error message added.
+	* emacs.eselect (set_symlinks): Check for range of array and
+	display error message.
 
 2007-03-29  Ulrich Mueller  <ulm@gentoo.org>
 
-	* version 0.7
-
-	* Svn keywords activated.
+	* Desktop entries and icons moved to emacs-desktop.
 
-	* Fixed typo and capitalised "Emacs" where appropriate.
+	* emacs.eselect.5: Fixed typo and capitalised "Emacs" where
+	appropriate. Added copyright notice.
 
-	* Added copyright notice.
+	* SVN keywords activated.
 
-	* Desktop entries and icons moved to emacs-desktop.
+	* version 0.7
 
 2007-03-28  Ulrich Mueller  <ulm@gentoo.org>
 
-	* version 0.6
+	* emacs.eselect.5: Added man page.
 
-	* Undo previous change
+	* emacs.eselect (do_set, do_update): Undo previous change.
 
-	* Added man page
+	* version 0.6
 
 2007-03-27  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Call env.eselect to update the environment from env.d files.
-
-	* Brought do_set and do_update more in line.
-
-	* Check for root in do_set and do_update.
+	* emacs.eselect (set_symlinks): env.eselect seems to be buggy; use
+	env-update instead.
+	(do_set, do_update): Brought more in line. Check for root.
+	Redundant remove_symlinks removed.
 
-	* env.eselect seems to be buggy; use env-update instead.
-
-	* Redundant remove_symlinks removed.
+	* emacs.eselect (set_symlinks): Call env.eselect to update the
+	environment from env.d files.
 
 2007-03-24  Ulrich Mueller  <ulm@gentoo.org>
 
-	* version 0.5
+	* emacsclient.desktop (Exec): Removed -n option.
 
-	* Removed -n option in emacsclient.desktop.
+	* version 0.5
 
 2007-03-23  Ulrich Mueller  <ulm@gentoo.org>
 
-	* MimeType and TryExec keys added to emacs.desktop.
+	* emacsclient.desktop: New file.
 
-	* Desktop file for emacsclient.
+	* emacs.desktop (MimeType, TryExec): Add keys.
 
 2007-03-22  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Handling of compression extensions made more robust.
+	* emacs.eselect: Added some comments.
 
 	* version 0.4
 
-	* Added some comments to emacs.eselect.
+	* emacs.eselect (set_man_symlinks): Handling of compression
+	extensions made more robust.
 
 2007-03-21  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Make linking to XEmacs auxiliary programs really work.
+	* emacs_*.png, gnured_48.png: Added two alternative icons (not
+		used yet): emacs_48.png is from etc/images/icons of the
+		Emacs sources, gnured_48.png is based on an image taken
+		from http://www.ee.ryerson.ca/~elf/emacs/logo/ and scaled
+		down.
 
-	* Some cleanup.
+	* emacs.desktop (Type): Set Type=Application only
 
-	* Set Type=Application only in desktop file.
-
-	* Added two alternative icons (not used yet):
-		emacs_48.png is from etc/images/icons of the Emacs sources,
-		gnured_48.png is based on an image taken from
-		http://www.ee.ryerson.ca/~elf/emacs/logo/ and scaled down.
+	* emacs.eselect (set_symlinks, set_bin_symlinks,
+	set_man_symlinks): Make linking to XEmacs auxiliary programs
+	really work. Some cleanup.
 
 2007-03-19  Christian Faulhammer  <opfer@gentoo.org>
 
@@ -104,42 +105,37 @@
 
 2007-03-19  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Removal of man page symlinks in remove_symlinks() simplified.
-
-	* Use emacs-${SLOT} instead of emacs-emacs-${SLOT} as symlink target.
-
-	* Test if Info directory exists.
+	* emacs.eselect (set_infopath): Test if Info directory exists.
+	(find_targets, set_symlinks): Use emacs-${SLOT} instead of
+	emacs-emacs-${SLOT} as symlink target.
 
 2007-03-18  Ulrich Mueller  <ulm@gentoo.org>
 
-	* version 0.2
+	* emacs.eselect (set_bin_symlinks, set_symlinks, do_update):
+	If Emacs was not found, link {c,e}tags to XEmacs versions.
+	(set_man_symlinks, set_symlinks, do_show, do_list): Suffix changed
+	from ".emacs-${SLOT}" to "-emacs-${SLOT}".
+	(remove_symlinks): Removal of man page symlinks simplified.
 
-	* If Emacs was not found, link {c,e}tags to XEmacs versions.
-
-	* Suffix changed from ".emacs-${SLOT}" to "-emacs-${SLOT}".
+	* version 0.2
 
 2007-03-17  Ulrich Mueller  <ulm@gentoo.org>
 
-	* do_update() now updates to the newest available version.
-
-	* Cleanup env.d file in do_update().
+	* emacs.eselect (do_update): Update to the newest available
+	version.
+	(remove_infopath): New function.
+	(remove_symlinks): Cleanup env.d file in do_update().
 
 2007-03-16  Ulrich Mueller  <ulm@gentoo.org>
 
-	* Remove man symlinks with all possible compress extensions.
-
-	* Honour ${ROOT} in set_man_symlinks.
-
-	* Don't test for -z ${extension} since the empty string
-	  is a legal value (meaning no compression).
-
-	* We don't have "providers" but versions.
-
-	* Create symlinks for existing binaries only.
-
-	* Added gfdl to MANPAGELIST.
-
-	* Use MANPAGELIST instead of BINARYLIST for manpage removal.
+	* emacs.eselect (remove_symlinks, set_man_symlinks): Remove man
+	symlinks with all possible compress extensions. Honour ${ROOT} in
+	set_man_symlinks. Don't test for -z ${extension} since the empty
+	string is a legal value (meaning no compression).
+	(do_set, do_update): We don't have "providers" but versions.
+	(remove_symlinks, set_symlinks): Create symlinks for existing
+	binaries only. Added gfdl to MANPAGELIST. Use MANPAGELIST instead
+	of BINARYLIST for manpage removal.
 
 2007-03-15  Christian Faulhammer  <opfer@gentoo.org>
 

diff --git a/emacs.eselect b/emacs.eselect
index 70b3c9b..54709ca 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -122,9 +122,11 @@ set_symlinks() {
 }
 
 xemacs_info() {
-	# This is just informational to tell that XEmacs has been found, a wish from graaff
-	if [[ -e /usr/bin/xemacs ]]; then
-		write_kv_list_entry "XEmacs also available"
+	# This is just informational to tell that XEmacs has been found,
+	# a wish from graaff
+	if [[ -e "${ROOT}/usr/bin/xemacs" ]]; then
+		echo
+		write_list_start "XEmacs is also available"
 	fi
 }
 



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     0431fb90618d96dadbe153a3a51841149f23218b
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue May 29 10:02:05 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 29 10:02:05 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=0431fb90

	* Took a check for modification right from do_update() to own
	function and use them in do_set(), too

	* Made a ndash out of a divis

	* Added quotes around use of ROOT variable in remove_infopath(),
	set_man_symlinks(), set_infopath(), find_targets(), do_list()

	* Commented functions remove_infopath()

	* Moved the comment for find_targets(), set_infopath(),
	remove_symlinks(), set_bin_symlinks(), set_man_symlinks(),set_symlinks()

	* Brief overview of functions completed in the header of the module

	* Change wording: implementation -> version

svn path=/emacs-extra/eselect-emacs/; revision=344

---
 emacs.eselect |   46 ++++++++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index 7adf8ff..f884daf 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -8,7 +8,7 @@
 # * show		do_show()
 # * list		do_list()
 # * set			do_set()
-# * update		do_update()
+# * update	do_update()
 #
 # Behaviour:
 # do_show():
@@ -16,11 +16,11 @@
 #  if yes, it outputs the currently linked Emacs version.
 #  If it is no symlink, the user is told so, the same if there is
 #  no /usr/bin/emacs or the target does not exist.
-# do_list():
-# do_set():
-# do_update():
+# do_list(): List all available versions of GNU Emacs
+# do_set(): Set a version to be target of the symlink.
+# do_update(): Check if the target is still valid and reset it
 
-DESCRIPTION="Manage /usr/bin/emacs implementations"
+DESCRIPTION="Manage /usr/bin/emacs version"
 MAINTAINER="emacs@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )
@@ -28,26 +28,27 @@ VERSION=$(svn_date_to_version "${SVN_DATE}" )
 BINARYLIST="emacsclient etags ctags b2m ebrowse rcs-checkin grep-changelog"
 MANPAGELIST="emacs emacsclient etags ctags gfdl"
 
-# Return the list of available Emacs binaries
 find_targets() {
+	# Return the list of available Emacs binaries
 	local j
-	for j in ${ROOT}/usr/bin/emacs-[0-9]*; do
+	for j in "${ROOT}"/usr/bin/emacs-[0-9]*; do
 		[[ -f ${j} ]] && basename ${j}
 	done
 }
 
 remove_infopath() {
-	rm -f ${ROOT}/etc/env.d/50emacs
+	# When cleaning symlinks this takes care of the info documentation settings
+	rm -f "${ROOT}/etc/env.d/50emacs"
 }
 
 # Define INFOPATH environment variable in env file
 set_infopath() {
-	[[ -d ${ROOT}/usr/share/info/${1} ]] || return 1
-	echo "INFOPATH=/usr/share/info/${1}" >${ROOT}/etc/env.d/50emacs
+	[[ -d "${ROOT}"/usr/share/info/${1} ]] || return 1
+	echo "INFOPATH=/usr/share/info/${1}" > "${ROOT}/etc/env.d/50emacs"
 }
 
-# Remove existing symlinks to binaries, man pages, and the env file
 remove_symlinks() {
+	# Remove existing symlinks to binaries, man pages, and the env file (own function)
 	local f
 	rm -f "${ROOT}"/usr/bin/emacs
 	for f in ${BINARYLIST}; do
@@ -59,8 +60,8 @@ remove_symlinks() {
 	remove_infopath
 }
 
-# Set symlinks to binaries in /usr/bin
 set_bin_symlinks() {
+	# Set symlinks to binaries in /usr/bin/
 	local target=${1} f
 	for f in ${BINARYLIST}; do
 		# set symlink only if target binary actually exists
@@ -71,11 +72,11 @@ set_bin_symlinks() {
 	done
 }
 
-# Set symlinks to man pages
 set_man_symlinks() {
+	# Set symlinks to man pages
 	local target=${1} extension f i
 	for f in ${MANPAGELIST}; do
-		for i in ${ROOT}/usr/share/man/man1/${f}-${target}.1*; do
+		for i in "${ROOT}"/usr/share/man/man1/${f}-${target}.1*; do
 			if [[ -f ${i} ]]; then
 				# target file exists; determine compress extension
 				extension=${i##*/${f}-${target}.1}
@@ -86,8 +87,8 @@ set_man_symlinks() {
 	done
 }
 
-# Set symlinks to binaries and man pages, update info path
 set_symlinks() {
+	# Set symlinks to binaries and man pages, update info path
 	local target="${1}" targets
 	# target may be specified by its name or its index
 	if is_number "${target}"; then
@@ -130,6 +131,11 @@ xemacs_info() {
 	fi
 }
 
+test_for_root() {
+	# checks if the user has rights to modify /usr/bin/
+	[[ -w "${ROOT}/usr/bin" ]] || die -q "You need to be root!"
+}
+
 ### show action ###
 
 describe_show() {
@@ -168,7 +174,7 @@ do_list() {
 	if [[ -n ${targets[@]} ]]; then
 		for (( i = 0; i < ${#targets[@]}; i = i + 1 )); do
 			[[ ${targets[${i}]} = \
-				$(basename $(canonicalise ${ROOT}/usr/bin/emacs) ) ]] &&
+				$(basename $(canonicalise "${ROOT}/usr/bin/emacs") ) ]] &&
 				# Display a star to indicate the currently chosen version
 				targets[${i}]="${targets[${i}]} $(highlight '*')"
 		done
@@ -197,7 +203,7 @@ describe_set_parameters() {
 do_set() {
 	[[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink to"
 	[[ -n "${2}" ]] && die -q "Too many parameters"
-	[[ -w "${ROOT}/usr/bin" ]] || die -q "You need to be root!"
+	test_for_root
 
 	if [[ -L "${ROOT}/usr/bin/emacs" ]]; then
 		remove_symlinks || die -q "Couldn't remove existing symlink"
@@ -215,13 +221,13 @@ describe_update() {
 }
 
 describe_update_options() {
-	echo "--if-unset : Do not override existing implementation"
+	echo "--if-unset : Do not override currently set version"
 }
 
 do_update() {
 	[[ -z "${1}" || ( -z "${2}" && "${1}" == "--if-unset" ) ]] ||
 		die -q "Usage error"
-	[[ -w "${ROOT}/usr/bin" ]] || die -q "You need to be root!"
+	test_for_root
 
 	if [[ -L "${ROOT}/usr/bin/emacs" ]]; then
 		[[ ${1} == "--if-unset" \
@@ -235,7 +241,7 @@ do_update() {
 	if [[ ${#targets[@]} -gt 0 ]]; then
 		set_symlinks ${#targets[@]} || die -q "Couldn't set a new symlink"
 	elif [[ -f "${ROOT}/usr/bin/xemacs" ]]; then
-		# no Emacs target found - link ctags, etags etc. to XEmacs versions
+		# no Emacs target found -- link ctags, etags etc. to XEmacs versions
 		set_symlinks xemacs
 	fi
 }



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     986474b17811aa4f0254592f3f62c63ef30cb2b7
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue May 29 10:05:13 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 29 10:05:13 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=986474b1

ChangeLog for all previously made changes

svn path=/emacs-extra/eselect-emacs/; revision=345

---
 ChangeLog |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index adf8c8d..9c420d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2007-05-29  Christian Faulhammer  <opfer@gentoo.org>
+
+	* Added a comment to Makefile
+
+	* Took a check for modification right from do_update() to own
+	function and use them in do_set(), too
+
+	* Made a ndash out of a divis
+
+	* Added quotes around use of ROOT variable in remove_infopath(),
+	set_man_symlinks(), set_infopath(), find_targets(), do_list()
+
+	* Commented functions remove_infopath()
+
+	* Moved the comment for find_targets(), set_infopath(),
+	remove_symlinks(), set_bin_symlinks(), set_man_symlinks(),set_symlinks()
+
+	* Brief overview of functions completed in the header of the module
+
+	* Change wording: implementation -> version
+
 2007-05-24  Ulrich Mueller  <ulm@gentoo.org>
 
 	* emacs.eselect (xemacs_info): Use write_list_start function.
@@ -13,7 +34,7 @@
 	* version 0.9
 
 	* Give a message for list command if XEmacs is found (request by
-	Hans de Graaff
+	Hans de Graaff)
 
 	* added a note about that behaviour in man page
 



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     f9ce9714ce95a77c257283c20b3dc4c08f96127e
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue May 29 10:08:15 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 29 10:08:15 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=f9ce9714

	* Changed description of do_update()

svn path=/emacs-extra/eselect-emacs/; revision=346

---
 emacs.eselect |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index f884daf..335c2c8 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -18,7 +18,7 @@
 #  no /usr/bin/emacs or the target does not exist.
 # do_list(): List all available versions of GNU Emacs
 # do_set(): Set a version to be target of the symlink.
-# do_update(): Check if the target is still valid and reset it
+# do_update(): Set the target to the highest version available (optionally: only if not set)
 
 DESCRIPTION="Manage /usr/bin/emacs version"
 MAINTAINER="emacs@gentoo.org"



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     01ef2a612a14afd29ab48f2811439494b6c6c2fb
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue May 29 10:01:28 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 29 10:01:28 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=01ef2a61

Added a comment

svn path=/emacs-extra/eselect-emacs/; revision=343

---
 Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 214ccda..bb830ff 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+# This Makefile creates the tarball to be uploaded to the Gentoo mirrors
+#
+
 PN = eselect-emacs
 #PV = $(shell sed '/^Version/h;$$!d;g;s/[^0-9.]*\([0-9.]*\).*/\1/' ChangeLog)
 PV = $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*\([0-9.]*\).*/\1/;q' \



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     68dcf38d5e089e5ab043cb4e90b0baac5a1a0bce
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue May 29 10:08:27 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 29 10:08:27 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=68dcf38d

ChangeLog

svn path=/emacs-extra/eselect-emacs/; revision=347

---
 ChangeLog |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9c420d2..dddc1a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2007-05-29  Christian Faulhammer  <opfer@gentoo.org>
 
+	* Changed description of do_update()
+
 	* Added a comment to Makefile
 
 	* Took a check for modification right from do_update() to own



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     b277c1ae132079ba211a274f9c2966958cf88378
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  5 17:09:10 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Jun  5 17:09:10 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=b277c1ae

ChangeLog, I should learn to commit both of them together

svn path=/emacs-extra/eselect-emacs/; revision=368

---
 ChangeLog |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dddc1a6..9a60973 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-06-05  Christian Faulhammer  <opfer@gentoo.org>
+
+	* added an additional die for remove_symlinks() in set_symlinks()
+
+	* rephrased output in do_set() and do_update()
+
+	* rewrote parts do_set() in such a way that an invalid target does
+	not cause an undefined state.  An invalid target was checked after
+	the symlinks were deleted and then not setting a new target
+
 2007-05-29  Christian Faulhammer  <opfer@gentoo.org>
 
 	* Changed description of do_update()



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     010c4f3814eded6c9742fed765ce92565634f502
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  6 07:33:38 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 07:33:38 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=010c4f38

Add a comment.

svn path=/emacs-extra/eselect-emacs/; revision=370

---
 emacs.eselect |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index 6443de4..13349b2 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -8,7 +8,7 @@
 # * show		do_show()
 # * list		do_list()
 # * set			do_set()
-# * update	do_update()
+# * update		do_update()
 #
 # Behaviour:
 # do_show():
@@ -233,6 +233,8 @@ do_update() {
 	if [[ -L "${ROOT}/usr/bin/emacs" ]]; then
 		[[ ${1} == "--if-unset" \
 			&& -e "$(canonicalise ${ROOT}/usr/bin/emacs)" ]] && return
+		# 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}/usr/bin/emacs" ]]; then
 		die -q "Sorry, ${ROOT}/usr/bin/emacs exists but is not a symlink"



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     68e0de6a0646fd5803f57da93118ab0b4435f2a7
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  5 18:55:06 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Jun  5 18:55:06 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=68e0de6a

Some trivial reformatting, mainly break long lines.

svn path=/emacs-extra/eselect-emacs/; revision=369

---
 emacs.eselect |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index 4c0ac9d..6443de4 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -12,13 +12,14 @@
 #
 # Behaviour:
 # do_show():
-#  Checks if /usr/bin/emacs is a link and if the target exists,
-#  if yes, it outputs the currently linked Emacs version.
-#  If it is no symlink, the user is told so, the same if there is
-#  no /usr/bin/emacs or the target does not exist.
+#	Checks if /usr/bin/emacs is a link and if the target exists,
+#	if yes, it outputs the currently linked Emacs version.
+#	If it is no symlink, the user is told so, the same if there is
+#	no /usr/bin/emacs or the target does not exist.
 # do_list(): List all available versions of GNU Emacs
 # do_set(): Set a version to be target of the symlink.
-# do_update(): Set the target to the highest version available (optionally: only if not set)
+# do_update(): Set the target to the highest version available
+#	(optionally: only if not set)
 
 DESCRIPTION="Manage /usr/bin/emacs version"
 MAINTAINER="emacs@gentoo.org"
@@ -48,7 +49,8 @@ set_infopath() {
 }
 
 remove_symlinks() {
-	# Remove existing symlinks to binaries, man pages, and the env file (own function)
+	# Remove existing symlinks to binaries, man pages,
+	# and the env file (own function)
 	local f
 	rm -f "${ROOT}"/usr/bin/emacs
 	for f in ${BINARYLIST}; do
@@ -173,10 +175,10 @@ do_list() {
 
 	if [[ -n ${targets[@]} ]]; then
 		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/emacs") ) ]] &&
-				# Display a star to indicate the currently chosen version
-				targets[${i}]="${targets[${i}]} $(highlight '*')"
+				$(basename $(canonicalise "${ROOT}/usr/bin/emacs") ) ]] \
+				&& targets[${i}]="${targets[${i}]} $(highlight '*')"
 		done
 		write_list_start "Available GNU Emacs symlink targets:"
 		write_numbered_list "${targets[@]}"
@@ -205,7 +207,8 @@ do_set() {
 	[[ -n "${2}" ]] && die -q "Too many parameters"
 	test_for_root
 
-	if [[ -e "${ROOT}/usr/bin/emacs" ]] && ! [[ -L "${ROOT}/usr/bin/emacs" ]]; then
+	if [[ -e "${ROOT}/usr/bin/emacs" ]] \
+		&& ! [[ -L "${ROOT}/usr/bin/emacs" ]]; then
 		die -q "Sorry, ${ROOT}/usr/bin/emacs exists but is not a symlink"
 	fi
 
@@ -223,8 +226,8 @@ describe_update_options() {
 }
 
 do_update() {
-	[[ -z "${1}" || ( -z "${2}" && "${1}" == "--if-unset" ) ]] ||
-		die -q "Usage error"
+	[[ -z "${1}" || ( -z "${2}" && "${1}" == "--if-unset" ) ]] \
+		|| die -q "Usage error"
 	test_for_root
 
 	if [[ -L "${ROOT}/usr/bin/emacs" ]]; then



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     8a68ceeb005bd83efada18e686fc10640b849297
Author:     Christian Faulhammer <opfer <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  5 17:08:29 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Jun  5 17:08:29 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=8a68ceeb

	* added an additional die for remove_symlinks() in set_symlinks()

	* rephrased output in do_set() and do_update()

	* rewrote parts do_set() in such a way that an invalid target does
	not cause an undefined state.  An invalid target was checked after
	the symlinks were deleted and then not setting a new target

svn path=/emacs-extra/eselect-emacs/; revision=367

---
 emacs.eselect |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index 335c2c8..4c0ac9d 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -67,7 +67,7 @@ set_bin_symlinks() {
 		# set symlink only if target binary actually exists
 		if [[ -f "${ROOT}/usr/bin/${f}-${target}" ]]; then
 			ln -s "${f}-${target}" "${ROOT}/usr/bin/${f}" ||
-				die "Couldn't set ${f}-${target} /usr/bin/${f} symlink"
+				die "Couldn't set ${f}-${target} ${ROOT}/usr/bin/${f} symlink"
 		fi
 	done
 }
@@ -104,12 +104,12 @@ set_symlinks() {
 		|| die -q "Target \"${1}\" doesn't appear to be valid!"
 
 	echo "Switching to ${target} ..."
-	remove_symlinks
+	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)
 	if [[ ${target} == emacs-* ]]; then
 		ln -s "${target}" "${ROOT}/usr/bin/emacs" \
-			|| die "Couldn't set ${target} /usr/bin/emacs symlink"
+			|| die "Couldn't set ${target} ${ROOT}/usr/bin/emacs symlink"
 	fi
 	set_bin_symlinks "${target}"
 	set_man_symlinks "${target}"
@@ -205,10 +205,8 @@ do_set() {
 	[[ -n "${2}" ]] && die -q "Too many parameters"
 	test_for_root
 
-	if [[ -L "${ROOT}/usr/bin/emacs" ]]; then
-		remove_symlinks || die -q "Couldn't remove existing symlink"
-	elif [[ -e "${ROOT}/usr/bin/emacs" ]]; then
-		die -q "Sorry, ${ROOT}/usr/bin/emacs exists and is not a symlink"
+	if [[ -e "${ROOT}/usr/bin/emacs" ]] && ! [[ -L "${ROOT}/usr/bin/emacs" ]]; then
+		die -q "Sorry, ${ROOT}/usr/bin/emacs exists but is not a symlink"
 	fi
 
 	set_symlinks "${1}" || die -q "Couldn't set a new symlink"
@@ -234,7 +232,7 @@ do_update() {
 			&& -e "$(canonicalise ${ROOT}/usr/bin/emacs)" ]] && return
 		remove_symlinks || die -q "Couldn't remove existing symlink"
 	elif [[ -e "${ROOT}/usr/bin/emacs" ]]; then
-		die -q "Sorry, ${ROOT}/usr/bin/emacs exists and is not a symlink"
+		die -q "Sorry, ${ROOT}/usr/bin/emacs exists but is not a symlink"
 	fi
 
 	local targets=( $(find_targets) )



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     3cb40485bd2f466917d962cec35745ecc71102e8
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  9 22:02:28 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jun  9 22:02:28 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=3cb40485

Add env-emacs.eselect, taken from eselect-1.0.9.

svn path=/emacs-extra/eselect-emacs/; revision=380

---
 env-emacs.eselect |  291 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 291 insertions(+), 0 deletions(-)

diff --git a/env-emacs.eselect b/env-emacs.eselect
new file mode 100644
index 0000000..5b977bf
--- /dev/null
+++ b/env-emacs.eselect
@@ -0,0 +1,291 @@
+# 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"
+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=( )
+
+# 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"
+}
+
+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
+	
+	# Create configuration files
+	create_profile_env
+	create_ld_so_conf
+	[[ -e ${ROOT}/usr/sbin/prelink ]] && create_prelink_conf
+	makelinks=$( ( need_links || [[ ${1} == makelinks ]] ) && echo "-X" )
+	update_ldcache ${makelinks}
+		
+	# 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



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     6ad92f033249d0563fe44657d04a5a6b82439c55
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 13:53:56 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 13:53:56 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=6ad92f03

Test for number of parameters. Quote variables correctly.

svn path=/emacs-extra/eselect-emacs/; revision=448

---
 ChangeLog     |    5 +++++
 emacs.eselect |   14 +++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b64ef9a..6ef0d99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-22  Ulrich Mueller  <ulm@gentoo.org>
+
+	* emacs.eselect (do_show, do_list, do_set, do_update): Test for
+	number of parameters. Quote variables correctly.
+
 2007-06-17  Ulrich Mueller  <ulm@gentoo.org>
 
 	* version 1.0

diff --git a/emacs.eselect b/emacs.eselect
index ab413d0..895368c 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -145,13 +145,13 @@ describe_show() {
 }
 
 do_show() {
-	[[ -z "${@}" ]] || die -q "Too many parameters"
+	[[ ${#@} -gt 0 ]] && die -q "Too many parameters"
 
 	write_list_start "Current target of GNU Emacs symlink:"
 	if [[ -L "${ROOT}/usr/bin/emacs" && \
 		  -e $(canonicalise "${ROOT}/usr/bin/emacs") ]]; then
 		write_kv_list_entry \
-			"$(basename $(canonicalise ${ROOT}/usr/bin/emacs) )" ""
+			$(basename $(canonicalise "${ROOT}/usr/bin/emacs") ) ""
 	elif [[ -e "${ROOT}/usr/bin/emacs" ]]; then
 		write_kv_list_entry \
 			"(not a symlink or target of symlink does not exist)" ""
@@ -168,7 +168,7 @@ describe_list() {
 }
 
 do_list() {
-	[[ -z "${@}" ]] || die -q "Too many parameters"
+	[[ ${#@} -gt 0 ]] && die -q "Too many parameters"
 
 	local i targets
 	targets=( $(find_targets) )
@@ -204,7 +204,7 @@ describe_set_parameters() {
 
 do_set() {
 	[[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink to"
-	[[ -n "${2}" ]] && die -q "Too many parameters"
+	[[ ${#@} -gt 1 ]] && die -q "Too many parameters"
 	test_for_root
 
 	if [[ -e "${ROOT}/usr/bin/emacs" ]] \
@@ -226,13 +226,13 @@ describe_update_options() {
 }
 
 do_update() {
-	[[ -z "${1}" || ( -z "${2}" && "${1}" == "--if-unset" ) ]] \
-		|| die -q "Usage error"
+	[[ -z "${1}" || "${1}" == "--if-unset" ]] || die -q "Usage error"
+	[[ ${#@} -gt 1 ]] && die -q "Too many parameters"
 	test_for_root
 
 	if [[ -L "${ROOT}/usr/bin/emacs" ]]; then
 		[[ ${1} == "--if-unset" \
-			&& -e "$(canonicalise ${ROOT}/usr/bin/emacs)" ]] && return
+			&& -e $(canonicalise "${ROOT}/usr/bin/emacs") ]] && return
 		# 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"



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

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



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     f03f0098fc2e2296146b98eae21daaaadd60794e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 17 15:12:48 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jun 17 15:12:48 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=f03f0098

Release version 1.0.

svn path=/emacs-extra/eselect-emacs/; revision=418

---
 ChangeLog     |    2 ++
 emacs.eselect |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc46376..b64ef9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2007-06-17  Ulrich Mueller  <ulm@gentoo.org>
 
+	* version 1.0
+
 	* emacs.eselect (set_symlinks): Call env.eselect module;
 	it supports the "noldconfig" option since eselect version 1.0.10.
 

diff --git a/emacs.eselect b/emacs.eselect
index 90498d9..ab413d0 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -1,7 +1,7 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
-# Version: 0.9
+# Version: 1.0
 #
 # DOCUMENTATION
 # Following actions possible



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     8c9d5ceb1423b1afec6ed9fc1f03f80c900933a2
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  9 22:21:58 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jun  9 22:21:58 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=8c9d5ceb

Support for --no-ldconfig option in env-emacs.eselect.

svn path=/emacs-extra/eselect-emacs/; revision=381

---
 ChangeLog         |    7 +++++++
 Makefile          |    2 +-
 emacs.eselect     |    4 ++--
 env-emacs.eselect |   30 +++++++++++++++++++++++-------
 4 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9a60973..60e9870 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-10  Ulrich Mueller  <ulm@gentoo.org>
+
+	* env-emacs.eselect: New file, taken from env.eselect of
+	eselect-1.0.9, extended to support the --no-ldconfig option.
+
+	* Makefile (DISTFILES): env-emacs.eselect added.
+
 2007-06-05  Christian Faulhammer  <opfer@gentoo.org>
 
 	* added an additional die for remove_symlinks() in set_symlinks()

diff --git a/Makefile b/Makefile
index bb830ff..a6b6b73 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 emacs.eselect.5
+DISTFILES = emacs.eselect env-emacs.eselect emacs.eselect.5
 
 
 .PHONY: all dist clean

diff --git a/emacs.eselect b/emacs.eselect
index 13349b2..5bb00c8 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -118,7 +118,7 @@ set_symlinks() {
 	set_infopath "${target}"
 
 	# update /etc/profile.env from /etc/env.d files
-	#do_action env update >/dev/null
+	#do_action env-emacs update --no-ldconfig >/dev/null
 	env-update --no-ldconfig
 
 	return 0
@@ -129,7 +129,7 @@ xemacs_info() {
 	# a wish from graaff
 	if [[ -e "${ROOT}/usr/bin/xemacs" ]]; then
 		echo
-		write_list_start "XEmacs is also available"
+		write_list_start "XEmacs is also installed"
 	fi
 }
 

diff --git a/env-emacs.eselect b/env-emacs.eselect
index 5b977bf..a441941 100644
--- a/env-emacs.eselect
+++ b/env-emacs.eselect
@@ -5,7 +5,8 @@
 inherit config multilib
 
 DESCRIPTION="Manage environment variables set in /etc/env.d/"
-MAINTAINER="kugelfang@gentoo.org"
+#MAINTAINER="kugelfang@gentoo.org"
+MAINTAINER="emacs@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )
 
@@ -106,6 +107,7 @@ create_profile_env() {
 			-e '/^#/d' -e '/^\s*$/d' -e '/^.*=/s/^\([^=]*\)=.*/\1/' \
 			${envfile})
 		[[ -z ${vars} ]] && continue
+		local ${vars}			# workaround for bug #172472
 		for var in ${vars} ; do
 			# Colon separated?...
 			if has ${var} ${PATH_CLASS} ; then
@@ -261,6 +263,7 @@ describe_update_parameters() {
 
 describe_update_options() {
 	echo "makelinks : Specify \"makelinks\" to force updating of links"
+	echo "--no-ldconfig : Do not run ldconfig"
 }
 
 do_update() {
@@ -270,14 +273,27 @@ do_update() {
 	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
-	create_ld_so_conf
-	[[ -e ${ROOT}/usr/sbin/prelink ]] && create_prelink_conf
-	makelinks=$( ( need_links || [[ ${1} == makelinks ]] ) && echo "-X" )
-	update_ldcache ${makelinks}
-		
+	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 \



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     0cfc840128ce934df925a71e246b4c033ed6c303
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 10 13:19:45 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jun 10 13:19:45 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=0cfc8401

Workaround for bug #172472.

svn path=/emacs-extra/eselect-emacs/; revision=382

---
 emacs.eselect     |    2 +-
 env-emacs.eselect |   36 +++++++++++++++++++++---------------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/emacs.eselect b/emacs.eselect
index 5bb00c8..0b0a9a4 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -118,7 +118,7 @@ set_symlinks() {
 	set_infopath "${target}"
 
 	# update /etc/profile.env from /etc/env.d files
-	#do_action env-emacs update --no-ldconfig >/dev/null
+	#do_action env-emacs update --no-ldconfig
 	env-update --no-ldconfig
 
 	return 0

diff --git a/env-emacs.eselect b/env-emacs.eselect
index a441941..c791ca3 100644
--- a/env-emacs.eselect
+++ b/env-emacs.eselect
@@ -40,6 +40,13 @@ 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() {
@@ -69,13 +76,13 @@ update_envvar_classes() {
 	for envfile in ${envfiles[@]} ; do
 		is_envfile ${envfile} || continue
 
-		value=$(load_config ${envfile} COLON_SEPARATED)
+		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)
+		value=$(load_config_ ${envfile} SPACE_SEPARATED)
 		for x in ${value} ; do
 			has ${x} ${SPACE_CLASS} && continue
 			SPACE_CLASS="${SPACE_CLASS} ${x}"
@@ -107,15 +114,14 @@ create_profile_env() {
 			-e '/^#/d' -e '/^\s*$/d' -e '/^.*=/s/^\([^=]*\)=.*/\1/' \
 			${envfile})
 		[[ -z ${vars} ]] && continue
-		local ${vars}			# workaround for bug #172472
 		for var in ${vars} ; do
 			# Colon separated?...
 			if has ${var} ${PATH_CLASS} ; then
-				store=$(load_config ${tmpprofile} ${var})
+				store=$(load_config_ ${tmpprofile} ${var})
 				if [[ -z ${store} ]] ; then
-					store=$(load_config ${envfile} ${var})
+					store=$(load_config_ ${envfile} ${var})
 				else
-					items="$(load_config ${envfile} ${var})"
+					items="$(load_config_ ${envfile} ${var})"
 					items=( ${items//:/ } )
 					for item in ${items[@]} ; do
 						has ${item} ${store//:/ } && continue
@@ -127,11 +133,11 @@ create_profile_env() {
 			fi
 			# Space separated!...
 			if has ${var} ${SPACE_CLASS} ; then
-				store=( $(load_config ${tmpprofile} ${var}) )
+				store=( $(load_config_ ${tmpprofile} ${var}) )
 				if [[ -z ${store[@]} ]] ; then
-					store=( $(load_config ${envfile} ${var}) )
+					store=( $(load_config_ ${envfile} ${var}) )
 				else
-					items=( $(load_config ${envfile} ${var}) )
+					items=( $(load_config_ ${envfile} ${var}) )
 					for item in ${items[@]} ; do
 						has ${item} ${store[@]} && continue
 						store=( ${store[@]} ${item} )
@@ -144,12 +150,12 @@ create_profile_env() {
 			store_config \
 				${tmpprofile} \
 				${var} \
-				"$(load_config ${envfile} ${var})"
+				"$(load_config_ ${envfile} ${var})"
 		done
 	
 		has LDPATH ${vars} || continue
 		# Store LDPATH for later processing
-		items=$(load_config ${envfile} LDPATH)
+		items=$(load_config_ ${envfile} LDPATH)
 		items=( ${items//:/ } )
 		for item in ${items[@]} ; do
 			has ${item} ${LDPATH[@]} && continue 
@@ -194,10 +200,10 @@ create_prelink_conf() {
 		[[ -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=$(load_config_ ${ENVPROFILE} PRELINK_PATH_MASK)
 	prelink_mask=( ${prelink_mask//:/ } )
-	prelink="$(load_config ${ENVPROFILE} PATH)"
-	prelink="${prelink} $(load_config ${ENVPROFILE} PRELINK_PATH)"
+	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
@@ -219,7 +225,7 @@ need_links() {
 		y=${y//-/_}
 		y=${y//./_}
 		y=${y//+/_}
-		oldmtime=$(load_config ${LDMTIMEDB} "mtime${y}")
+		oldmtime=$(load_config_ ${LDMTIMEDB} "mtime${y}")
 		newmtime=$(stat -c %Y ${x} 2> /dev/null)
 		if [[ ${oldmtime} != ${newmtime} ]] ; then
 			ret=0



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     da8c73d626d9023fb6c27973bee0e66679c40c89
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 19:33:58 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 19:33:58 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=da8c73d6

Minor formatting changes. Fix copy&paste error in manpage.

svn path=/emacs-extra/eselect-emacs/; revision=451

---
 ctags.eselect   |    5 ++---
 ctags.eselect.5 |    2 +-
 emacs.eselect   |    3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/ctags.eselect b/ctags.eselect
index 0522c0d..a3a9c73 100644
--- a/ctags.eselect
+++ b/ctags.eselect
@@ -164,8 +164,7 @@ 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 [[ -e "${ROOT}/usr/bin/ctags" && ! -L "${ROOT}/usr/bin/ctags" ]]; then
 		die -q "Sorry, ${ROOT}/usr/bin/ctags exists but is not a symlink"
 	fi
 
@@ -185,7 +184,6 @@ do_update() {
 	local ctags=""
 	if [[ -L "${ROOT}/usr/bin/ctags" ]]; then
 		ctags=$(basename $(canonicalise "${ROOT}/usr/bin/ctags") )
-		[[ "${ctags}" == ctags-*emacs* ]] && ctags="ctags-*emacs*"
 		if [[ ! -e $(canonicalise "${ROOT}/usr/bin/ctags") ]]; then
 			# clean up dead symlinks
 			remove_symlinks || die -q "Couldn't remove existing symlink"
@@ -201,6 +199,7 @@ do_update() {
 	local i target targets=( $(find_targets) )
 	if [[ ${#targets[@]} -gt 0 ]]; then
 		target=${targets[0]}
+		[[ "${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 47023e4..3d97c8e 100644
--- a/ctags.eselect.5
+++ b/ctags.eselect.5
@@ -14,7 +14,7 @@ ctags.eselect \- The ctags management module for Gentoo's eselect
 .br
 \fBeselect ctags show\fR
 .br
-\fBeselect ctags update\fR [\fI--if-unset\fR]
+\fBeselect ctags update\fR
 .SH "DESCRIPTION"
 \fBeselect\fR is Gentoo's configuration and management tool. It features
 modules that care for the individual administrative tasks.

diff --git a/emacs.eselect b/emacs.eselect
index 895368c..ddaa16c 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -207,8 +207,7 @@ do_set() {
 	[[ ${#@} -gt 1 ]] && die -q "Too many parameters"
 	test_for_root
 
-	if [[ -e "${ROOT}/usr/bin/emacs" ]] \
-		&& ! [[ -L "${ROOT}/usr/bin/emacs" ]]; then
+	if [[ -e "${ROOT}/usr/bin/emacs" && ! -L "${ROOT}/usr/bin/emacs" ]]; then
 		die -q "Sorry, ${ROOT}/usr/bin/emacs exists but is not a symlink"
 	fi
 



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     e430d1a95b9db2fa78a5eb3bc9943d33cc8f4fdc
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 19:55:43 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 19:55:43 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=e430d1a9

emacs.eselect calls ctags eselect module now.

svn path=/emacs-extra/eselect-emacs/; revision=452

---
 ChangeLog     |    9 +++++++++
 Makefile      |    2 +-
 emacs.eselect |   13 ++++++++++---
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6ef0d99..9e0ea9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-06-22  Ulrich Mueller  <ulm@gentoo.org>
 
+	* Makefile (DISTFILES): Add ctags.eselect and ctags.eselect.5.
+
+	* emacs.eselect (do_set, do_update): Call ctags module.
+	(BINARYLIST, MANPAGELIST): Remove ctags from lists.
+
+	* ctags.eselect.5: New file, man page.
+
+	* ctags.eselect: New file, eselect module for ctags, bug #29398.
+
 	* emacs.eselect (do_show, do_list, do_set, do_update): Test for
 	number of parameters. Quote variables correctly.
 

diff --git a/Makefile b/Makefile
index bb830ff..4de037f 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 emacs.eselect.5
+DISTFILES = emacs.eselect ctags.eselect emacs.eselect.5 ctags.eselect.5
 
 
 .PHONY: all dist clean

diff --git a/emacs.eselect b/emacs.eselect
index ddaa16c..492cee1 100644
--- a/emacs.eselect
+++ b/emacs.eselect
@@ -1,7 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
-# Version: 1.0
 #
 # DOCUMENTATION
 # Following actions possible
@@ -26,8 +25,10 @@ MAINTAINER="emacs@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )
 
-BINARYLIST="emacsclient etags ctags b2m ebrowse rcs-checkin grep-changelog"
-MANPAGELIST="emacs emacsclient etags ctags gfdl"
+#BINARYLIST="emacsclient etags ctags b2m ebrowse rcs-checkin grep-changelog"
+#MANPAGELIST="emacs emacsclient etags ctags gfdl"
+BINARYLIST="emacsclient etags b2m ebrowse rcs-checkin grep-changelog"
+MANPAGELIST="emacs emacsclient etags gfdl"
 
 find_targets() {
 	# Return the list of available Emacs binaries
@@ -212,6 +213,9 @@ do_set() {
 	fi
 
 	set_symlinks "${1}" || die -q "Couldn't set a new symlink"
+
+	# ctags symlinks are handled in an own module now
+	do_action ctags update
 }
 
 ### update action ###
@@ -246,4 +250,7 @@ do_update() {
 		# no Emacs target found -- link ctags, etags etc. to XEmacs versions
 		set_symlinks xemacs
 	fi
+
+	# ctags symlinks are handled in an own module now
+	do_action ctags update
 }



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     9a31dba71ae92dfd96b0ad911d6211e0c7da0387
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 14:40:13 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 14:40:13 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=9a31dba7

Remove describe_update_options().

svn path=/emacs-extra/eselect-emacs/; revision=450

---
 ctags.eselect |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/ctags.eselect b/ctags.eselect
index a88c3fa..0522c0d 100644
--- a/ctags.eselect
+++ b/ctags.eselect
@@ -1,7 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
-# Version: 1.0
 #
 # DOCUMENTATION
 # Following actions possible
@@ -179,10 +178,6 @@ describe_update() {
 	echo "Automatically update the ctags symlink"
 }
 
-describe_update_options() {
-	echo "--if-unset : Do not override currently set version"
-}
-
 do_update() {
 	[[ ${#@} -gt 0 ]] && die -q "Too many parameters"
 	test_for_root



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     ad0a9786dc3aa5805e83f068d9412ed05b8fbefa
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 22 14:09:23 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 22 14:09:23 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=ad0a9786

New eselect module for ctags.

svn path=/emacs-extra/eselect-emacs/; revision=449

---
 ctags.eselect   |  214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ctags.eselect.5 |   65 +++++++++++++++++
 emacs.eselect.5 |    6 +-
 3 files changed, 282 insertions(+), 3 deletions(-)

diff --git a/ctags.eselect b/ctags.eselect
new file mode 100644
index 0000000..a88c3fa
--- /dev/null
+++ b/ctags.eselect
@@ -0,0 +1,214 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+# Version: 1.0
+#
+# DOCUMENTATION
+# Following actions possible
+# * show		do_show()
+# * list		do_list()
+# * set			do_set()
+# * update		do_update()
+#
+# Behaviour:
+# do_show():
+#	Checks if /usr/bin/ctags is a link and if the target exists,
+#	if yes, it outputs the currently linked ctags implementation.
+#	If it is no symlink, the user is told so, the same if there is
+#	no /usr/bin/ctags or the target does not exist.
+# do_list(): List all available ctags implementations.
+# 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"
+MAINTAINER="emacs@gentoo.org"
+SVN_DATE='$Date$'
+VERSION=$(svn_date_to_version "${SVN_DATE}" )
+
+find_targets() {
+	# Return the list of available ctags implementations
+
+	# (X)Emacs: offer only one ctags implementation, namely for the
+	# 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}/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}"
+	elif [[ -f "${ROOT}/usr/bin/xemacs" ]]; then
+		[[ -f "${ROOT}/usr/bin/ctags-xemacs" ]] && echo ctags-xemacs
+	fi
+
+	# Exuberant ctags
+	[[ -f "${ROOT}"/usr/bin/exuberant-ctags ]] && echo exuberant-ctags
+}
+
+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*
+}
+
+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"
+}
+
+set_man_symlinks() {
+	# Set symlink to man page
+	local target=${1} extension i
+	for i in "${ROOT}"/usr/share/man/man1/${target}.1*; do
+		if [[ -f ${i} ]]; then
+			# target file exists; determine compress extension
+			extension=${i##*/${target}.1}
+			ln -s "${target}.1${extension}" \
+				"${ROOT}/usr/share/man/man1/ctags.1${extension}"
+		fi
+	done
+}
+
+set_symlinks() {
+	# Set symlinks to binary and man page
+	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 ))]}
+	fi
+
+	# is the target valid, i.e. does a ctags binary with this name exist?
+	[[ -f "${ROOT}/usr/bin/${target}" ]] \
+		|| die -q "Target \"${1}\" doesn't appear to be valid!"
+
+	echo "Switching to ${target} ..."
+	remove_symlinks || die -q "Couldn't remove existing symlink"
+	set_bin_symlinks "${target}"
+	set_man_symlinks "${target}"
+	return 0
+}
+
+test_for_root() {
+	# checks if the user has rights to modify /usr/bin/
+	[[ -w "${ROOT}/usr/bin" ]] || die -q "You need to be root!"
+}
+
+### show action ###
+
+describe_show() {
+	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_kv_list_entry \
+			$(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
+		write_kv_list_entry "(unset)" ""
+	fi
+}
+
+### list action ###
+
+describe_list() {
+	echo "List available ctags symlink targets"
+}
+
+do_list() {
+	[[ ${#@} -gt 0 ]] && die -q "Too many parameters"
+
+	local i targets
+	targets=( $(find_targets) )
+
+	if [[ -n ${targets[@]} ]]; then
+		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") ) ]] \
+				&& targets[${i}]="${targets[${i}]} $(highlight '*')"
+		done
+		write_list_start "Available ctags symlink targets:"
+		write_numbered_list "${targets[@]}"
+	else
+		write_kv_list_entry "(none found)" ""
+	fi
+}
+
+### set action ###
+
+describe_set() {
+	echo "Set a new ctags symlink"
+}
+
+describe_set_options() {
+	echo "target : Target name or number (from 'list' action)"
+}
+
+describe_set_parameters() {
+	echo "<target>"
+}
+
+do_set() {
+	[[ -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}/usr/bin/ctags" ]] \
+		&& ! [[ -L "${ROOT}/usr/bin/ctags" ]]; then
+		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"
+}
+
+### update action ###
+
+describe_update() {
+	echo "Automatically update the ctags symlink"
+}
+
+describe_update_options() {
+	echo "--if-unset : Do not override currently set version"
+}
+
+do_update() {
+	[[ ${#@} -gt 0 ]] && die -q "Too many parameters"
+	test_for_root
+
+	local ctags=""
+	if [[ -L "${ROOT}/usr/bin/ctags" ]]; then
+		ctags=$(basename $(canonicalise "${ROOT}/usr/bin/ctags") )
+		[[ "${ctags}" == ctags-*emacs* ]] && ctags="ctags-*emacs*"
+		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
+		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
+	# 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 ]]; then
+		target=${targets[0]}
+		for i in ${targets[@]}; do
+			[[ "${i}" == "${ctags}" ]] && target="${i}"
+		done
+		set_symlinks "${target}" || die -q "Couldn't set a new symlink"
+	fi
+}

diff --git a/ctags.eselect.5 b/ctags.eselect.5
new file mode 100644
index 0000000..47023e4
--- /dev/null
+++ b/ctags.eselect.5
@@ -0,0 +1,65 @@
+.\" Copyright 1999-2007 Gentoo Foundation
+.\" Distributed under the terms of the GNU General Public License v2
+.\" $Id$
+.\"
+.TH "ESELECT" "22" "June 2007" "Gentoo Linux" "eselect"
+.SH "NAME"
+ctags.eselect \- The ctags management module for Gentoo's eselect
+.SH "SYNOPSIS"
+\fBeselect ctags\fR [\fBhelp\fR|\fBusage\fR]
+.br
+\fBeselect ctags list\fR
+.br
+\fBeselect ctags set\fR \fItarget\fR
+.br
+\fBeselect ctags show\fR
+.br
+\fBeselect ctags update\fR [\fI--if-unset\fR]
+.SH "DESCRIPTION"
+\fBeselect\fR is Gentoo's configuration and management tool. It features
+modules that care for the individual administrative tasks.
+.SH "ACTION: LIST"
+\fBeselect ctags list\fR
+.br
+List all installed ctags versions.
+
+# eselect ctags list
+.br
+Available ctags symlink targets:
+.br
+  [1]   ctags-emacs-22 *
+  [2]   exuberant-ctags
+.SH "ACTION: SET"
+\fBeselect ctags set\fR \fItarget\fR
+.br
+Activates the selected ctags version. \fItarget\fR can be either an
+identification number given by \fBeselect ctags list\fR or the name of
+one installed version.
+
+# eselect ctags set 2
+.br
+Switching to exuberant-ctags ...
+.SH "ACTION: SHOW"
+\fBeselect ctags show\fR [\fItarget\fR]
+.br
+Prints the currently activated ctags version.
+
+# eselect ctags show
+.br
+Current target of symlink:
+.br
+  exuberant-ctags
+.SH "ACTION: UPDATE"
+\fBeselect ctags update\fR
+.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.
+
+# eselect ctags update
+.br
+Switching to exuberant-ctags ...
+.SH "AUTHOR"
+Ulrich Mueller <ulm@gentoo.org>
+.SH "REVISION"
+$Id$

diff --git a/emacs.eselect.5 b/emacs.eselect.5
index 25936fe..c916cce 100644
--- a/emacs.eselect.5
+++ b/emacs.eselect.5
@@ -40,7 +40,7 @@ one installed version.
 
 # eselect emacs set 3
 .br
-Switching to emacs-22...
+Switching to emacs-22 ...
 .SH "ACTION: SHOW"
 \fBeselect emacs show\fR [\fItarget\fR]
 .br
@@ -50,7 +50,7 @@ Prints the currently activated Emacs version.
 .br
 Current target of symlink:
 .br
-emacs-22
+  emacs-22
 .SH "ACTION: UPDATE"
 \fBeselect emacs update\fR [\fI--if-unset\fR]
 .br
@@ -60,7 +60,7 @@ overridden.
 
 # eselect emacs update
 .br
-Switching to emacs-22...
+Switching to emacs-22 ...
 .SH "AUTHORS"
 Christian Faulhammer <opfer@gentoo.org>
 .br



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     6f22f41a529c741faa313873e0f7775433552f6c
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 25 07:27:24 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jun 25 07:27:24 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=6f22f41a

Put ChangeLog in tarball.

svn path=/emacs-extra/eselect-emacs/; revision=473

---
 Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index fc98328..8ca91f9 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,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
+DISTFILES = emacs.eselect ctags.eselect \
+	emacs.eselect.5 ctags.eselect.5 ChangeLog
 
 
 .PHONY: all dist clean



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     28a7247fcd7d974961b4734a2be2a4cc11d35e55
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 17:22:27 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 17:22:27 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=28a7247f

Update man pages.

svn path=/emacs-extra/eselect-emacs/; revision=461

---
 Makefile        |    2 +-
 ctags.eselect.5 |    3 +++
 emacs.eselect.5 |   12 ++++++++++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 4de037f..fc98328 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 
 PN = eselect-emacs
 #PV = $(shell sed '/^Version/h;$$!d;g;s/[^0-9.]*\([0-9.]*\).*/\1/' ChangeLog)
-PV = $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*\([0-9.]*\).*/\1/;q' \
+PV = $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*\([^ \t]*\).*/\1/;q' \
 	ChangeLog)
 P = $(PN)-$(PV)
 

diff --git a/ctags.eselect.5 b/ctags.eselect.5
index 3d97c8e..9ee20e4 100644
--- a/ctags.eselect.5
+++ b/ctags.eselect.5
@@ -59,6 +59,9 @@ but not the provider (i.e. Emacs vs Exuberant). At the moment only
 # eselect ctags update
 .br
 Switching to exuberant-ctags ...
+.SH "SEE ALSO"
+.BR eselect (1),
+.BR emacs.eselect (5)
 .SH "AUTHOR"
 Ulrich Mueller <ulm@gentoo.org>
 .SH "REVISION"

diff --git a/emacs.eselect.5 b/emacs.eselect.5
index c916cce..a39055b 100644
--- a/emacs.eselect.5
+++ b/emacs.eselect.5
@@ -26,7 +26,7 @@ been found on your system.
 
 # eselect emacs list
 .br
-Available Emacs symlink targets:
+Available GNU Emacs symlink targets:
 .br
   [1]   emacs-18
   [2]   emacs-21 *
@@ -37,10 +37,13 @@ Available Emacs symlink targets:
 Activates the selected Emacs version. \fItarget\fR can be either an
 identification number given by \fBeselect emacs list\fR or the name of
 one installed version.
+.BR ctags.eselect ( 5 )
 
 # eselect emacs set 3
 .br
 Switching to emacs-22 ...
+.br
+Switching to ctags-emacs-22 ...
 .SH "ACTION: SHOW"
 \fBeselect emacs show\fR [\fItarget\fR]
 .br
@@ -48,7 +51,7 @@ Prints the currently activated Emacs version.
 
 # eselect emacs show
 .br
-Current target of symlink:
+Current target of GNU Emacs symlink:
 .br
   emacs-22
 .SH "ACTION: UPDATE"
@@ -61,6 +64,11 @@ overridden.
 # eselect emacs update
 .br
 Switching to emacs-22 ...
+.br
+Switching to ctags-emacs-22 ...
+.SH "SEE ALSO"
+.BR eselect (1),
+.BR ctags.eselect (5)
 .SH "AUTHORS"
 Christian Faulhammer <opfer@gentoo.org>
 .br



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     9b84406ec09a541ae7609ca06bf339d9147fdd24
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 19:51:23 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 19:51:23 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=9b84406e

Fix copy&paste error in manpage.

svn path=/emacs-extra/eselect-emacs/; revision=463

---
 emacs.eselect.5 |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/emacs.eselect.5 b/emacs.eselect.5
index a39055b..09af78e 100644
--- a/emacs.eselect.5
+++ b/emacs.eselect.5
@@ -37,7 +37,6 @@ Available GNU Emacs symlink targets:
 Activates the selected Emacs version. \fItarget\fR can be either an
 identification number given by \fBeselect emacs list\fR or the name of
 one installed version.
-.BR ctags.eselect ( 5 )
 
 # eselect emacs set 3
 .br



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: /
@ 2012-06-22 17:29 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-22 17:29 UTC (permalink / raw
  To: gentoo-commits

commit:     c0abca439b2b3cdf50a3be7de8dd6468cbe21dab
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 29 04:50:38 2007 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 29 04:50:38 2007 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=c0abca43

Release version 1.1.

svn path=/emacs-extra/eselect-emacs/; revision=514

---
 ChangeLog |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e0ea9f..ca23258 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-06-29  Ulrich Mueller  <ulm@gentoo.org>
+
+	* version 1.1
+
 2007-06-22  Ulrich Mueller  <ulm@gentoo.org>
 
 	* Makefile (DISTFILES): Add ctags.eselect and ctags.eselect.5.



^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-06-22 17:31 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 17:29 [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: / Ulrich Mueller
  -- strict thread matches above, loose matches on Subject: below --
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
2012-06-22 17:29 Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox