public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] eselect r754 - in trunk/extern: . modules
@ 2010-01-27 21:30 Ulrich Mueller (ulm)
  0 siblings, 0 replies; only message in thread
From: Ulrich Mueller (ulm) @ 2010-01-27 21:30 UTC (permalink / raw
  To: gentoo-commits

Author: ulm
Date: 2010-01-27 21:30:30 +0000 (Wed, 27 Jan 2010)
New Revision: 754

Modified:
   trunk/extern/ChangeLog
   trunk/extern/modules/esd.eselect
Log:
Use EROOT throughout, bug 302134.

Modified: trunk/extern/ChangeLog
===================================================================
--- trunk/extern/ChangeLog	2010-01-23 11:31:13 UTC (rev 753)
+++ trunk/extern/ChangeLog	2010-01-27 21:30:30 UTC (rev 754)
@@ -1,3 +1,8 @@
+2010-01-27  Ulrich Mueller  <ulm@gentoo.org>
+
+	* modules/esd.eselect: Use EROOT throughout, bug 302134.
+	Fix quoting.
+
 2009-11-22  Ulrich Mueller  <ulm@gentoo.org>
 
 	* modules/oracle.eselect: Module removed. See bug 292111.

Modified: trunk/extern/modules/esd.eselect
===================================================================
--- trunk/extern/modules/esd.eselect	2010-01-23 11:31:13 UTC (rev 753)
+++ trunk/extern/modules/esd.eselect	2010-01-27 21:30:30 UTC (rev 754)
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -11,9 +11,9 @@
 # find a list of esd symlink targets, best first
 find_targets() {
 	for f in \
-			${ROOT}/usr/bin/esound-esd \
-			${ROOT}/usr/bin/esdcompat \
-		; do
+		"${EROOT}/usr/bin/esound-esd" \
+		"${EROOT}/usr/bin/esdcompat"
+	do
 		if [[ -f ${f} ]] ; then
 			echo $(basename ${f} )
 		fi
@@ -22,7 +22,7 @@
 
 # try to remove the esd symlink
 remove_symlink() {
-	rm "${ROOT}/usr/bin/esd" &>/dev/null
+	rm "${EROOT}/usr/bin/esd" &>/dev/null
 }
 
 # set the esd symlink
@@ -32,10 +32,10 @@
 		targets=( $(find_targets ) )
 		target=${targets[$(( ${target} - 1 ))]}
 	fi
-	if [[ -f "${ROOT}/usr/bin/${target}" ]] ; then
+	if [[ -f ${EROOT}/usr/bin/${target} ]] ; then
 		remove_symlink
-		ln -s "${ROOT}/usr/bin/${target}" "${ROOT}/usr/bin/esd" || \
-			die "Couldn't set ${target} symlink"
+		ln -s "${EROOT}/usr/bin/${target}" "${EROOT}/usr/bin/esd" \
+			|| die "Couldn't set ${target} symlink"
 	else
 		die -q  "Target \"${1}\" doesn't appear to be valid!"
 	fi
@@ -51,9 +51,10 @@
 	[[ -z "${@}" ]] || die -q "Too many parameters"
 
 	write_list_start "Current ESounD implementation:"
-	if [[ -L "${ROOT}/usr/bin/esd" ]] ; then
-		write_kv_list_entry "$(basename $(canonicalise ${ROOT}/usr/bin/esd ) )" ""
-	elif [[ -e "${ROOT}/usr/bin/esd" ]] ; then
+	if [[ -L ${EROOT}/usr/bin/esd ]] ; then
+		write_kv_list_entry \
+			"$(basename "$(canonicalise "${EROOT}/usr/bin/esd")")" ""
+	elif [[ -e ${EROOT}/usr/bin/esd ]] ; then
 		write_kv_list_entry "(not a symlink)" ""
 	else
 		write_kv_list_entry "(unset)" ""
@@ -77,7 +78,7 @@
 	for (( i = 0; i < ${#targets[@]}; i++ )); do
 		targetname="targetname_${targets[${i}]/-/_}"
 		if [[ ${targets[i]} = \
-			$(basename "$(canonicalise "${ROOT}/usr/bin/esd")") ]]
+			$(basename "$(canonicalise "${EROOT}/usr/bin/esd")") ]]
 		then
 			targets[i]=$(highlight_marker "${!targetname}")
 		else
@@ -109,15 +110,15 @@
 	elif [[ -n "${2}" ]] ; then
 		die -q "Too many parameters"
 
-	elif [[ -L "${ROOT}/usr/bin/esd" ]] ; then
+	elif [[ -L ${EROOT}/usr/bin/esd ]] ; then
 		if ! remove_symlink ; then
 			die -q "Can't remove existing provider"
 		elif ! set_symlink "${1}" ; then
 			die -q "Can't set new provider"
 		fi
 
-	elif [[ -e "${ROOT}/usr/bin/esd" ]] ; then
-		die -q "Sorry, ${ROOT}/usr/bin/esd confuses me"
+	elif [[ -e ${EROOT}/usr/bin/esd ]] ; then
+		die -q "Sorry, ${EROOT}/usr/bin/esd confuses me"
 
 	else
 		set_symlink "${1}" || die -q "Can't set a new provider"
@@ -138,11 +139,11 @@
 	[[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \
 		die -q "Usage error"
 
-	if [[ -L "${ROOT}/usr/bin/esd" ]] ; then
+	if [[ -L ${EROOT}/usr/bin/esd ]] ; then
 		[[ ${1} == "--if-unset" ]] && return
 		remove_symlink || die -q "Can't remove existing link"
 	fi
-	if [[ -e "${ROOT}/usr/bin/esd" ]] ; then
+	if [[ -e ${EROOT}/usr/bin/esd ]] ; then
 		die -q "Can't set a new provider"
 	elif ! [[ -z $(find_targets ) ]] ; then
 		set_symlink 1 || die -q "Can't set a new provider"




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-27 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-27 21:30 [gentoo-commits] eselect r754 - in trunk/extern: . modules Ulrich Mueller (ulm)

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