Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] eselect r754 - in trunk/extern: . modules
Date: Wed, 27 Jan 2010 21:30:34
Message-Id: E1NaFT5-00020G-8I@stork.gentoo.org
1 Author: ulm
2 Date: 2010-01-27 21:30:30 +0000 (Wed, 27 Jan 2010)
3 New Revision: 754
4
5 Modified:
6 trunk/extern/ChangeLog
7 trunk/extern/modules/esd.eselect
8 Log:
9 Use EROOT throughout, bug 302134.
10
11 Modified: trunk/extern/ChangeLog
12 ===================================================================
13 --- trunk/extern/ChangeLog 2010-01-23 11:31:13 UTC (rev 753)
14 +++ trunk/extern/ChangeLog 2010-01-27 21:30:30 UTC (rev 754)
15 @@ -1,3 +1,8 @@
16 +2010-01-27 Ulrich Mueller <ulm@g.o>
17 +
18 + * modules/esd.eselect: Use EROOT throughout, bug 302134.
19 + Fix quoting.
20 +
21 2009-11-22 Ulrich Mueller <ulm@g.o>
22
23 * modules/oracle.eselect: Module removed. See bug 292111.
24
25 Modified: trunk/extern/modules/esd.eselect
26 ===================================================================
27 --- trunk/extern/modules/esd.eselect 2010-01-23 11:31:13 UTC (rev 753)
28 +++ trunk/extern/modules/esd.eselect 2010-01-27 21:30:30 UTC (rev 754)
29 @@ -1,5 +1,5 @@
30 # -*-eselect-*- vim: ft=eselect
31 -# Copyright 1999-2006 Gentoo Foundation
32 +# Copyright 1999-2010 Gentoo Foundation
33 # Distributed under the terms of the GNU General Public License v2
34 # $Id$
35
36 @@ -11,9 +11,9 @@
37 # find a list of esd symlink targets, best first
38 find_targets() {
39 for f in \
40 - ${ROOT}/usr/bin/esound-esd \
41 - ${ROOT}/usr/bin/esdcompat \
42 - ; do
43 + "${EROOT}/usr/bin/esound-esd" \
44 + "${EROOT}/usr/bin/esdcompat"
45 + do
46 if [[ -f ${f} ]] ; then
47 echo $(basename ${f} )
48 fi
49 @@ -22,7 +22,7 @@
50
51 # try to remove the esd symlink
52 remove_symlink() {
53 - rm "${ROOT}/usr/bin/esd" &>/dev/null
54 + rm "${EROOT}/usr/bin/esd" &>/dev/null
55 }
56
57 # set the esd symlink
58 @@ -32,10 +32,10 @@
59 targets=( $(find_targets ) )
60 target=${targets[$(( ${target} - 1 ))]}
61 fi
62 - if [[ -f "${ROOT}/usr/bin/${target}" ]] ; then
63 + if [[ -f ${EROOT}/usr/bin/${target} ]] ; then
64 remove_symlink
65 - ln -s "${ROOT}/usr/bin/${target}" "${ROOT}/usr/bin/esd" || \
66 - die "Couldn't set ${target} symlink"
67 + ln -s "${EROOT}/usr/bin/${target}" "${EROOT}/usr/bin/esd" \
68 + || die "Couldn't set ${target} symlink"
69 else
70 die -q "Target \"${1}\" doesn't appear to be valid!"
71 fi
72 @@ -51,9 +51,10 @@
73 [[ -z "${@}" ]] || die -q "Too many parameters"
74
75 write_list_start "Current ESounD implementation:"
76 - if [[ -L "${ROOT}/usr/bin/esd" ]] ; then
77 - write_kv_list_entry "$(basename $(canonicalise ${ROOT}/usr/bin/esd ) )" ""
78 - elif [[ -e "${ROOT}/usr/bin/esd" ]] ; then
79 + if [[ -L ${EROOT}/usr/bin/esd ]] ; then
80 + write_kv_list_entry \
81 + "$(basename "$(canonicalise "${EROOT}/usr/bin/esd")")" ""
82 + elif [[ -e ${EROOT}/usr/bin/esd ]] ; then
83 write_kv_list_entry "(not a symlink)" ""
84 else
85 write_kv_list_entry "(unset)" ""
86 @@ -77,7 +78,7 @@
87 for (( i = 0; i < ${#targets[@]}; i++ )); do
88 targetname="targetname_${targets[${i}]/-/_}"
89 if [[ ${targets[i]} = \
90 - $(basename "$(canonicalise "${ROOT}/usr/bin/esd")") ]]
91 + $(basename "$(canonicalise "${EROOT}/usr/bin/esd")") ]]
92 then
93 targets[i]=$(highlight_marker "${!targetname}")
94 else
95 @@ -109,15 +110,15 @@
96 elif [[ -n "${2}" ]] ; then
97 die -q "Too many parameters"
98
99 - elif [[ -L "${ROOT}/usr/bin/esd" ]] ; then
100 + elif [[ -L ${EROOT}/usr/bin/esd ]] ; then
101 if ! remove_symlink ; then
102 die -q "Can't remove existing provider"
103 elif ! set_symlink "${1}" ; then
104 die -q "Can't set new provider"
105 fi
106
107 - elif [[ -e "${ROOT}/usr/bin/esd" ]] ; then
108 - die -q "Sorry, ${ROOT}/usr/bin/esd confuses me"
109 + elif [[ -e ${EROOT}/usr/bin/esd ]] ; then
110 + die -q "Sorry, ${EROOT}/usr/bin/esd confuses me"
111
112 else
113 set_symlink "${1}" || die -q "Can't set a new provider"
114 @@ -138,11 +139,11 @@
115 [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \
116 die -q "Usage error"
117
118 - if [[ -L "${ROOT}/usr/bin/esd" ]] ; then
119 + if [[ -L ${EROOT}/usr/bin/esd ]] ; then
120 [[ ${1} == "--if-unset" ]] && return
121 remove_symlink || die -q "Can't remove existing link"
122 fi
123 - if [[ -e "${ROOT}/usr/bin/esd" ]] ; then
124 + if [[ -e ${EROOT}/usr/bin/esd ]] ; then
125 die -q "Can't set a new provider"
126 elif ! [[ -z $(find_targets ) ]] ; then
127 set_symlink 1 || die -q "Can't set a new provider"