Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: app-admin/eselect/, app-admin/eselect/files/
Date: Thu, 02 Apr 2015 10:34:07
Message-Id: 1427970004.0c228168dd58e43fe32a14aa3b346e91521d0a95.jlec@gentoo
1 commit: 0c228168dd58e43fe32a14aa3b346e91521d0a95
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 2 10:20:04 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 2 10:20:04 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=0c228168
7
8 app-admin/eselect: Drop old
9
10 Package-Manager: portage-2.2.18
11
12 app-admin/eselect/ChangeLog | 7 +
13 app-admin/eselect/eselect-1.3.7-r100.ebuild | 72 ---
14 app-admin/eselect/eselect-1.3.8-r100.ebuild | 72 ---
15 app-admin/eselect/eselect-1.4-r100.ebuild | 72 ---
16 app-admin/eselect/eselect-1.4.1-r100.ebuild | 72 ---
17 app-admin/eselect/eselect-1.4.2-r100.ebuild | 72 ---
18 app-admin/eselect/eselect-1.4.3-r100.ebuild | 72 ---
19 .../eselect/files/eselect-1.3.8-alternatives.patch | 616 --------------------
20 app-admin/eselect/files/eselect-alternatives.patch | 618 ---------------------
21 9 files changed, 7 insertions(+), 1666 deletions(-)
22
23 diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
24 index 29de45c..cc795da 100644
25 --- a/app-admin/eselect/ChangeLog
26 +++ b/app-admin/eselect/ChangeLog
27 @@ -2,6 +2,13 @@
28 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
29 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
30
31 + 02 Apr 2015; Justin Lecher <jlec@g.o> -eselect-1.3.7-r100.ebuild,
32 + -eselect-1.3.8-r100.ebuild, -eselect-1.4-r100.ebuild,
33 + -eselect-1.4.1-r100.ebuild, -eselect-1.4.2-r100.ebuild,
34 + -eselect-1.4.3-r100.ebuild, -files/eselect-1.3.8-alternatives.patch,
35 + -files/eselect-alternatives.patch:
36 + app-admin/eselect: Drop old
37 +
38 *eselect-1.4.4-r100 (26 Jan 2015)
39
40 26 Jan 2015; Justin Lecher <jlec@g.o> +eselect-1.4.4-r100.ebuild:
41
42 diff --git a/app-admin/eselect/eselect-1.3.7-r100.ebuild b/app-admin/eselect/eselect-1.3.7-r100.ebuild
43 deleted file mode 100644
44 index 6be2133..0000000
45 --- a/app-admin/eselect/eselect-1.3.7-r100.ebuild
46 +++ /dev/null
47 @@ -1,72 +0,0 @@
48 -# Copyright 1999-2014 Gentoo Foundation
49 -# Distributed under the terms of the GNU General Public License v2
50 -# $Header: $
51 -
52 -EAPI=5
53 -
54 -inherit autotools eutils bash-completion-r1
55 -
56 -DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
57 -HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
58 -SRC_URI="mirror://gentoo/${P}.tar.xz"
59 -
60 -LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
61 -SLOT="0"
62 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
63 -IUSE="doc emacs vim-syntax"
64 -
65 -RDEPEND="sys-apps/sed
66 - || (
67 - sys-apps/coreutils
68 - sys-freebsd/freebsd-bin
69 - app-misc/realpath
70 - )"
71 -DEPEND="${RDEPEND}
72 - app-arch/xz-utils
73 - doc? ( dev-python/docutils )"
74 -RDEPEND="!app-admin/eselect-news
75 - ${RDEPEND}
76 - sys-apps/file
77 - sys-libs/ncurses"
78 -
79 -PDEPEND="emacs? ( app-emacs/eselect-mode )
80 - vim-syntax? ( app-vim/eselect-syntax )"
81 -
82 -src_prepare() {
83 - epatch "${FILESDIR}"/${PN}-alternatives.patch
84 - AT_M4DIR="." eautoreconf
85 -}
86 -
87 -src_compile() {
88 - emake
89 - use doc && emake html
90 -}
91 -
92 -src_install() {
93 - emake DESTDIR="${D}" install
94 - newbashcomp misc/${PN}.bashcomp ${PN}
95 - dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
96 - use doc && dohtml *.html doc/*
97 -
98 - # needed by news module
99 - keepdir /var/lib/gentoo/news
100 - if ! use prefix; then
101 - fowners root:portage /var/lib/gentoo/news
102 - fperms g+w /var/lib/gentoo/news
103 - fi
104 -
105 - # band aid for prefix
106 - if use prefix; then
107 - cd "${ED}"/usr/share/eselect/libs
108 - sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
109 - fi
110 -}
111 -
112 -pkg_postinst() {
113 - # fowners in src_install doesn't work for the portage group:
114 - # merging changes the group back to root
115 - if ! use prefix; then
116 - chgrp portage "${EROOT}/var/lib/gentoo/news" \
117 - && chmod g+w "${EROOT}/var/lib/gentoo/news"
118 - fi
119 -}
120
121 diff --git a/app-admin/eselect/eselect-1.3.8-r100.ebuild b/app-admin/eselect/eselect-1.3.8-r100.ebuild
122 deleted file mode 100644
123 index 700374b..0000000
124 --- a/app-admin/eselect/eselect-1.3.8-r100.ebuild
125 +++ /dev/null
126 @@ -1,72 +0,0 @@
127 -# Copyright 1999-2014 Gentoo Foundation
128 -# Distributed under the terms of the GNU General Public License v2
129 -# $Header: $
130 -
131 -EAPI=5
132 -
133 -inherit autotools eutils bash-completion-r1
134 -
135 -DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
136 -HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
137 -SRC_URI="mirror://gentoo/${P}.tar.xz"
138 -
139 -LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
140 -SLOT="0"
141 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
142 -IUSE="doc emacs vim-syntax"
143 -
144 -RDEPEND="sys-apps/sed
145 - || (
146 - sys-apps/coreutils
147 - sys-freebsd/freebsd-bin
148 - app-misc/realpath
149 - )"
150 -DEPEND="${RDEPEND}
151 - app-arch/xz-utils
152 - doc? ( dev-python/docutils )"
153 -RDEPEND="!app-admin/eselect-news
154 - ${RDEPEND}
155 - sys-apps/file
156 - sys-libs/ncurses"
157 -
158 -PDEPEND="emacs? ( app-emacs/eselect-mode )
159 - vim-syntax? ( app-vim/eselect-syntax )"
160 -
161 -src_prepare() {
162 - epatch "${FILESDIR}"/${P}-alternatives.patch
163 - AT_M4DIR="." eautoreconf
164 -}
165 -
166 -src_compile() {
167 - emake
168 - use doc && emake html
169 -}
170 -
171 -src_install() {
172 - emake DESTDIR="${D}" install
173 - newbashcomp misc/${PN}.bashcomp ${PN}
174 - dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
175 - use doc && dohtml *.html doc/*
176 -
177 - # needed by news module
178 - keepdir /var/lib/gentoo/news
179 - if ! use prefix; then
180 - fowners root:portage /var/lib/gentoo/news
181 - fperms g+w /var/lib/gentoo/news
182 - fi
183 -
184 - # band aid for prefix
185 - if use prefix; then
186 - cd "${ED}"/usr/share/eselect/libs
187 - sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
188 - fi
189 -}
190 -
191 -pkg_postinst() {
192 - # fowners in src_install doesn't work for the portage group:
193 - # merging changes the group back to root
194 - if ! use prefix; then
195 - chgrp portage "${EROOT}/var/lib/gentoo/news" \
196 - && chmod g+w "${EROOT}/var/lib/gentoo/news"
197 - fi
198 -}
199
200 diff --git a/app-admin/eselect/eselect-1.4-r100.ebuild b/app-admin/eselect/eselect-1.4-r100.ebuild
201 deleted file mode 100644
202 index e4d9a6f..0000000
203 --- a/app-admin/eselect/eselect-1.4-r100.ebuild
204 +++ /dev/null
205 @@ -1,72 +0,0 @@
206 -# Copyright 1999-2014 Gentoo Foundation
207 -# Distributed under the terms of the GNU General Public License v2
208 -# $Header: $
209 -
210 -EAPI=5
211 -
212 -inherit autotools eutils bash-completion-r1
213 -
214 -DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
215 -HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
216 -SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
217 -
218 -LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
219 -SLOT="0"
220 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
221 -IUSE="doc emacs vim-syntax"
222 -
223 -RDEPEND="sys-apps/sed
224 - || (
225 - sys-apps/coreutils
226 - sys-freebsd/freebsd-bin
227 - app-misc/realpath
228 - )"
229 -DEPEND="${RDEPEND}
230 - app-arch/xz-utils
231 - doc? ( dev-python/docutils )"
232 -RDEPEND="!app-admin/eselect-news
233 - ${RDEPEND}
234 - sys-apps/file
235 - sys-libs/ncurses"
236 -
237 -PDEPEND="emacs? ( app-emacs/eselect-mode )
238 - vim-syntax? ( app-vim/eselect-syntax )"
239 -
240 -src_prepare() {
241 - epatch "${FILESDIR}"/${PN}-1.3.8-alternatives.patch
242 - AT_M4DIR="." eautoreconf
243 -}
244 -
245 -src_compile() {
246 - emake
247 - use doc && emake html
248 -}
249 -
250 -src_install() {
251 - emake DESTDIR="${D}" install
252 - newbashcomp misc/${PN}.bashcomp ${PN}
253 - dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
254 - use doc && dohtml *.html doc/*
255 -
256 - # needed by news module
257 - keepdir /var/lib/gentoo/news
258 - if ! use prefix; then
259 - fowners root:portage /var/lib/gentoo/news
260 - fperms g+w /var/lib/gentoo/news
261 - fi
262 -
263 - # band aid for prefix
264 - if use prefix; then
265 - cd "${ED}"/usr/share/eselect/libs
266 - sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
267 - fi
268 -}
269 -
270 -pkg_postinst() {
271 - # fowners in src_install doesn't work for the portage group:
272 - # merging changes the group back to root
273 - if ! use prefix; then
274 - chgrp portage "${EROOT}/var/lib/gentoo/news" \
275 - && chmod g+w "${EROOT}/var/lib/gentoo/news"
276 - fi
277 -}
278
279 diff --git a/app-admin/eselect/eselect-1.4.1-r100.ebuild b/app-admin/eselect/eselect-1.4.1-r100.ebuild
280 deleted file mode 100644
281 index e4d9a6f..0000000
282 --- a/app-admin/eselect/eselect-1.4.1-r100.ebuild
283 +++ /dev/null
284 @@ -1,72 +0,0 @@
285 -# Copyright 1999-2014 Gentoo Foundation
286 -# Distributed under the terms of the GNU General Public License v2
287 -# $Header: $
288 -
289 -EAPI=5
290 -
291 -inherit autotools eutils bash-completion-r1
292 -
293 -DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
294 -HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
295 -SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
296 -
297 -LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
298 -SLOT="0"
299 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
300 -IUSE="doc emacs vim-syntax"
301 -
302 -RDEPEND="sys-apps/sed
303 - || (
304 - sys-apps/coreutils
305 - sys-freebsd/freebsd-bin
306 - app-misc/realpath
307 - )"
308 -DEPEND="${RDEPEND}
309 - app-arch/xz-utils
310 - doc? ( dev-python/docutils )"
311 -RDEPEND="!app-admin/eselect-news
312 - ${RDEPEND}
313 - sys-apps/file
314 - sys-libs/ncurses"
315 -
316 -PDEPEND="emacs? ( app-emacs/eselect-mode )
317 - vim-syntax? ( app-vim/eselect-syntax )"
318 -
319 -src_prepare() {
320 - epatch "${FILESDIR}"/${PN}-1.3.8-alternatives.patch
321 - AT_M4DIR="." eautoreconf
322 -}
323 -
324 -src_compile() {
325 - emake
326 - use doc && emake html
327 -}
328 -
329 -src_install() {
330 - emake DESTDIR="${D}" install
331 - newbashcomp misc/${PN}.bashcomp ${PN}
332 - dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
333 - use doc && dohtml *.html doc/*
334 -
335 - # needed by news module
336 - keepdir /var/lib/gentoo/news
337 - if ! use prefix; then
338 - fowners root:portage /var/lib/gentoo/news
339 - fperms g+w /var/lib/gentoo/news
340 - fi
341 -
342 - # band aid for prefix
343 - if use prefix; then
344 - cd "${ED}"/usr/share/eselect/libs
345 - sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
346 - fi
347 -}
348 -
349 -pkg_postinst() {
350 - # fowners in src_install doesn't work for the portage group:
351 - # merging changes the group back to root
352 - if ! use prefix; then
353 - chgrp portage "${EROOT}/var/lib/gentoo/news" \
354 - && chmod g+w "${EROOT}/var/lib/gentoo/news"
355 - fi
356 -}
357
358 diff --git a/app-admin/eselect/eselect-1.4.2-r100.ebuild b/app-admin/eselect/eselect-1.4.2-r100.ebuild
359 deleted file mode 100644
360 index 3fb583f..0000000
361 --- a/app-admin/eselect/eselect-1.4.2-r100.ebuild
362 +++ /dev/null
363 @@ -1,72 +0,0 @@
364 -# Copyright 1999-2014 Gentoo Foundation
365 -# Distributed under the terms of the GNU General Public License v2
366 -# $Header: $
367 -
368 -EAPI=5
369 -
370 -inherit autotools eutils bash-completion-r1
371 -
372 -DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
373 -HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
374 -SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
375 -
376 -LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
377 -SLOT="0"
378 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
379 -IUSE="doc emacs vim-syntax"
380 -
381 -RDEPEND="sys-apps/sed
382 - || (
383 - sys-apps/coreutils
384 - sys-freebsd/freebsd-bin
385 - app-misc/realpath
386 - )"
387 -DEPEND="${RDEPEND}
388 - app-arch/xz-utils
389 - doc? ( dev-python/docutils )"
390 -RDEPEND="!app-admin/eselect-news
391 - ${RDEPEND}
392 - sys-apps/file
393 - sys-libs/ncurses"
394 -
395 -PDEPEND="emacs? ( app-emacs/eselect-mode )
396 - vim-syntax? ( app-vim/eselect-syntax )"
397 -
398 -src_prepare() {
399 - epatch "${FILESDIR}"/${P}-alternatives.patch
400 - AT_M4DIR="." eautoreconf
401 -}
402 -
403 -src_compile() {
404 - emake
405 - use doc && emake html
406 -}
407 -
408 -src_install() {
409 - emake DESTDIR="${D}" install
410 - newbashcomp misc/${PN}.bashcomp ${PN}
411 - dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
412 - use doc && dohtml *.html doc/*
413 -
414 - # needed by news module
415 - keepdir /var/lib/gentoo/news
416 - if ! use prefix; then
417 - fowners root:portage /var/lib/gentoo/news
418 - fperms g+w /var/lib/gentoo/news
419 - fi
420 -
421 - # band aid for prefix
422 - if use prefix; then
423 - cd "${ED}"/usr/share/eselect/libs
424 - sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
425 - fi
426 -}
427 -
428 -pkg_postinst() {
429 - # fowners in src_install doesn't work for the portage group:
430 - # merging changes the group back to root
431 - if ! use prefix; then
432 - chgrp portage "${EROOT}/var/lib/gentoo/news" \
433 - && chmod g+w "${EROOT}/var/lib/gentoo/news"
434 - fi
435 -}
436
437 diff --git a/app-admin/eselect/eselect-1.4.3-r100.ebuild b/app-admin/eselect/eselect-1.4.3-r100.ebuild
438 deleted file mode 100644
439 index 5af5f87..0000000
440 --- a/app-admin/eselect/eselect-1.4.3-r100.ebuild
441 +++ /dev/null
442 @@ -1,72 +0,0 @@
443 -# Copyright 1999-2014 Gentoo Foundation
444 -# Distributed under the terms of the GNU General Public License v2
445 -# $Header: $
446 -
447 -EAPI=5
448 -
449 -inherit autotools eutils bash-completion-r1
450 -
451 -DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
452 -HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
453 -SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
454 -
455 -LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
456 -SLOT="0"
457 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
458 -IUSE="doc emacs vim-syntax"
459 -
460 -RDEPEND="sys-apps/sed
461 - || (
462 - sys-apps/coreutils
463 - sys-freebsd/freebsd-bin
464 - app-misc/realpath
465 - )"
466 -DEPEND="${RDEPEND}
467 - app-arch/xz-utils
468 - doc? ( dev-python/docutils )"
469 -RDEPEND="!app-admin/eselect-news
470 - ${RDEPEND}
471 - sys-apps/file
472 - sys-libs/ncurses"
473 -
474 -PDEPEND="emacs? ( app-emacs/eselect-mode )
475 - vim-syntax? ( app-vim/eselect-syntax )"
476 -
477 -src_prepare() {
478 - epatch "${FILESDIR}"/${PN}-1.4.2-alternatives.patch
479 - AT_M4DIR="." eautoreconf
480 -}
481 -
482 -src_compile() {
483 - emake
484 - use doc && emake html
485 -}
486 -
487 -src_install() {
488 - emake DESTDIR="${D}" install
489 - newbashcomp misc/${PN}.bashcomp ${PN}
490 - dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
491 - use doc && dohtml *.html doc/*
492 -
493 - # needed by news module
494 - keepdir /var/lib/gentoo/news
495 - if ! use prefix; then
496 - fowners root:portage /var/lib/gentoo/news
497 - fperms g+w /var/lib/gentoo/news
498 - fi
499 -
500 - # band aid for prefix
501 - if use prefix; then
502 - cd "${ED}"/usr/share/eselect/libs
503 - sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
504 - fi
505 -}
506 -
507 -pkg_postinst() {
508 - # fowners in src_install doesn't work for the portage group:
509 - # merging changes the group back to root
510 - if ! use prefix; then
511 - chgrp portage "${EROOT}/var/lib/gentoo/news" \
512 - && chmod g+w "${EROOT}/var/lib/gentoo/news"
513 - fi
514 -}
515
516 diff --git a/app-admin/eselect/files/eselect-1.3.8-alternatives.patch b/app-admin/eselect/files/eselect-1.3.8-alternatives.patch
517 deleted file mode 100644
518 index 1e3b0ea..0000000
519 --- a/app-admin/eselect/files/eselect-1.3.8-alternatives.patch
520 +++ /dev/null
521 @@ -1,616 +0,0 @@
522 -Index: bin/eselect.in
523 -===================================================================
524 ---- bin/eselect.in (revision 863)
525 -+++ bin/eselect.in (working copy)
526 -@@ -22,10 +22,15 @@
527 - # Where are modules installed by default?
528 - ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
529 -
530 -+# Where are auto-generated modules placed? (e.g. from alternatives-2.eclass)
531 -+ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
532 -+
533 - # Look in these places for modules
534 --ESELECT_MODULES_PATH=( \
535 -- "${HOME}/.eselect/modules" \
536 -- "${ESELECT_DEFAULT_MODULES_PATH}" )
537 -+ESELECT_MODULES_PATH=(
538 -+ "${HOME}/.eselect/modules"
539 -+ "${ESELECT_DEFAULT_MODULES_PATH}"
540 -+ "${ESELECT_AUTO_GENERATED_MODULES_PATH}"
541 -+)
542 -
543 - # Look in this place for libraries
544 - ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
545 ---- bin/Makefile.am.orig 2013-09-02 14:35:05.328684465 +0400
546 -+++ bin/Makefile.am 2013-09-02 14:49:50.895842067 +0400
547 -@@ -4,6 +4,7 @@
548 - dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
549 - -e 's,\@DATADIR\@,$(datadir),g' \
550 - -e 's,\@EPREFIX\@,$(EPREFIX),g' \
551 -+ -e 's,\@LIBEXECDIR\@,$(datadir),g' \
552 - -e 's,\@VERSION\@,$(VERSION)$(EXTRAVERSION),g'
553 -
554 - % : %.in
555 -Index: libs/Makefile.am
556 -===================================================================
557 ---- libs/Makefile.am (revision 863)
558 -+++ libs/Makefile.am (working copy)
559 -@@ -1,6 +1,7 @@
560 - eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
561 -
562 - eselectlibs_DATA = \
563 -+ alternatives.bash \
564 - config.bash \
565 - core.bash \
566 - default.eselect \
567 -@@ -14,6 +15,7 @@
568 - tests.bash
569 -
570 - EXTRA_DIST = \
571 -+ alternatives.bash.in \
572 - config.bash.in \
573 - core.bash.in \
574 - default.eselect.in \
575 -@@ -30,7 +32,8 @@
576 - -e 's,\@SED\@,@SED@,g' \
577 - -e 's,\@PORTAGEQ\@,@PORTAGEQ@,g' \
578 - -e 's,\@ENV_UPDATE\@,@ENV_UPDATE@,g' \
579 -- -e 's,\@CANONICALISE\@,@CANONICALISE@,g'
580 -+ -e 's,\@CANONICALISE\@,@CANONICALISE@,g' \
581 -+ -e 's,\@sysconfdir\@,@sysconfdir@,g'
582 -
583 - %.bash : %.bash.in
584 - @$(dosed) $< > $@
585 ---- libs/alternatives.bash.in.orig 1970-01-01 01:00:00.000000000 +0100
586 -+++ libs/alternatives.bash.in 2011-09-06 18:55:43.000000000 +0100
587 -@@ -0,0 +1,550 @@
588 -+# Copyright 2008 Mike Kelly
589 -+# Copyright 2009 David Leverton
590 -+# Copyright 2010 Bo Ørsted Andresen
591 -+# 2010: Adapted to eselect Sebastien Fabbro (who doesn't like copyrights)
592 -+# Distributed under the terms of the GNU General Public License v2
593 -+
594 -+inherit config output path-manipulation
595 -+
596 -+ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
597 -+ALTERNATIVESDIR="${EROOT}${ALTERNATIVESDIR_ROOTLESS}"
598 -+
599 -+get_current_provider() {
600 -+ local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
601 -+ if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
602 -+ local provider=$(readlink "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: readlink ${symlink} failed")
603 -+ [[ ${provider} == */* ]] && die "${dieprefix}: malformed target for ${symlink}"
604 -+
605 -+ if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ||
606 -+ ( -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} && ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ) ]]; then
607 -+ die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} is not a directory"
608 -+ fi
609 -+
610 -+ echo "${provider}"
611 -+
612 -+ elif [[ -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
613 -+ die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current is not a symlink"
614 -+ fi
615 -+}
616 -+
617 -+compare_importance() {
618 -+ local IFS=.
619 -+ local a=( ${1} ) b=( ${2} )
620 -+ local -i i=0
621 -+ while (( i<${#a[@]} && i<${#b[@]} )); do
622 -+ if (( a[i]<b[i] )); then
623 -+ return 0
624 -+ elif (( a[i]>b[i] )); then
625 -+ return 1
626 -+ fi
627 -+ i+=1
628 -+ done
629 -+ (( i<${#b[@]} ))
630 -+}
631 -+
632 -+sort_providers() {
633 -+ local begin=${1:-0}
634 -+ local count=${2:-${#providers[@]}}
635 -+ [[ ${count} -le 1 ]] && return 0
636 -+ sort_providers ${begin} $((count/2))
637 -+ sort_providers $((begin+count/2)) $((count-count/2))
638 -+ local left=( "${providers[@]:begin:count/2}" )
639 -+ local right=( "${providers[@]:begin+count/2:count-count/2}" )
640 -+ local -i x i=0 j=0
641 -+ for (( x=begin; x<begin+count; ++x )); do
642 -+ if (( j>=${#right[@]} )) || { (( i<${#left[@]} )) && compare_importance "${left[i]%%:*}" "${right[j]%%:*}"; }; then
643 -+ providers[x]=${left[i++]}
644 -+ else
645 -+ providers[x]=${right[j++]}
646 -+ fi
647 -+ done
648 -+}
649 -+
650 -+get_providers() {
651 -+ local p= importance providers=()
652 -+ for p in "${ALTERNATIVESDIR}/${ALTERNATIVE}"/* ; do
653 -+ [[ -d ${p} && ! -L ${p} ]] || continue
654 -+ p=${p##*/}
655 -+
656 -+ importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
657 -+ importance=${importance:-0}
658 -+ [[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
659 -+
660 -+ providers+=( "${importance}:${p}" )
661 -+ done
662 -+
663 -+ sort_providers
664 -+ for (( p=${#providers[@]}-1 ; p>=0 ; --p )); do
665 -+ echo "${providers[p]#*:}"
666 -+ done
667 -+}
668 -+
669 -+### show action ###
670 -+describe_show() {
671 -+ echo "Show the current provider in use for ${ALTERNATIVE}"
672 -+}
673 -+
674 -+do_show() {
675 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
676 -+ local current="$(get_current_provider)"
677 -+ if [[ -z "${current}" ]] ; then
678 -+ echo "(none)"
679 -+ return 2
680 -+ fi
681 -+ echo "${current}"
682 -+}
683 -+
684 -+options_show() {
685 -+ :
686 -+}
687 -+
688 -+### list action ###
689 -+describe_list() {
690 -+ echo "Lists all available providers for ${ALTERNATIVE}"
691 -+}
692 -+
693 -+do_list() {
694 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
695 -+ local n cur= providers=( $(get_providers) )
696 -+ write_list_start "Available providers for ${ALTERNATIVE}:"
697 -+
698 -+ cur="$(get_current_provider)"
699 -+
700 -+ if [[ -n "${providers[@]}" ]] ; then
701 -+ for (( n = 0 ; n < ${#providers[@]} ; ++n )) ; do
702 -+ [[ ${cur} == "${providers[${n}]}" ]] && \
703 -+ providers[${n}]="${providers[${n}]} $(highlight '*')"
704 -+ done
705 -+ write_numbered_list "${providers[@]}"
706 -+ else
707 -+ write_kv_list_entry "(none found)" ""
708 -+ fi
709 -+}
710 -+
711 -+options_list() {
712 -+ :
713 -+}
714 -+
715 -+### files action ###
716 -+describe_files() {
717 -+ echo "Lists symlinks provided by the currently selected provider"
718 -+}
719 -+
720 -+do_files() {
721 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
722 -+
723 -+ local cur="$(get_current_provider)" p=
724 -+ [[ -n "${cur}" ]] || die -q "No selected provider, hence no symlinks provided"
725 -+ local dieprefix="Could not list symlinks provided for ${ALTERNATIVE}"
726 -+
727 -+ local errors symlink rootsymlink
728 -+ while read -r -d '' symlink; do
729 -+ rootsymlink="${EROOT}${symlink}"
730 -+ rootsymlink=${rootsymlink//+(\/)/\/}
731 -+ echo "${rootsymlink}"
732 -+ if [[ -L ${rootsymlink} ]]; then
733 -+ if [[ ! -e ${rootsymlink} ]]; then
734 -+ write_error_msg "${rootsymlink} is dangling symlink"
735 -+ errors=yes
736 -+ fi
737 -+ elif [[ -d ${rootsymlink} ]]; then
738 -+ write_error_msg "${rootsymlink} is a directory"
739 -+ errors=yes
740 -+ elif [[ -e ${rootsymlink} ]]; then
741 -+ write_error_msg "${rootsymlink} exists but is not a symlink"
742 -+ errors=yes
743 -+ else
744 -+ write_error_msg "${rootsymlink} does not exist"
745 -+ errors=yes
746 -+ fi
747 -+ done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
748 -+}
749 -+
750 -+options_files() {
751 -+ :
752 -+}
753 -+
754 -+### set action ###
755 -+
756 -+describe_set() {
757 -+ echo "Sets a provider for ${ALTERNATIVE}"
758 -+}
759 -+
760 -+describe_set_parameters() {
761 -+ echo "[ --force ] <provider>"
762 -+}
763 -+
764 -+describe_set_options() {
765 -+ echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
766 -+ echo "<provider> : the name of the provider to use or the index of the provider preceeded by a dash"
767 -+}
768 -+
769 -+do_set() {
770 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
771 -+
772 -+ local force provider providers
773 -+ if [[ ${1} == --force ]]; then
774 -+ force=yes
775 -+ shift
776 -+ fi
777 -+
778 -+ if [[ ${1} == -+([[:digit:]]) ]]; then
779 -+ providers=( $(get_providers) )
780 -+ (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
781 -+ provider=${providers[${1#-}-1]}
782 -+ else
783 -+ provider="${1}"
784 -+ fi
785 -+ [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
786 -+ local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
787 -+
788 -+ if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
789 -+ if is_number ${provider} ; then
790 -+ providers=( $(get_providers) )
791 -+ [[ -n ${providers[${1#-}-1]} ]] &&
792 -+ die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
793 -+ fi
794 -+ die -q "The given provider (${provider}) does not exist"
795 -+ fi
796 -+
797 -+ local symlink newsymlinks=() oldsymlinks=()
798 -+
799 -+ while read -r -d '' symlink; do
800 -+ local nicesymlink=${symlink#.}
801 -+ nicesymlink=${nicesymlink//+(\/)/\/}
802 -+ [[ ${nicesymlink} == /* ]] || die "${dieprefix}: bad symlink ${symlink}?"
803 -+ [[ ${nicesymlink} == */ ]] && die "${dieprefix}: bad symlink ${symlink}?"
804 -+
805 -+ newsymlinks+=( "${nicesymlink}" )
806 -+ done < <(
807 -+ cd "${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}" || die "${dieprefix}: cd failed"
808 -+ find . -type l -print0 | LC_ALL=C sort -r -u -z)
809 -+ [[ ${#newsymlinks[@]} -gt 0 ]] || die "${dieprefix}: does not provide any symlinks?"
810 -+
811 -+ if [[ -f ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
812 -+ while read -r -d '' symlink; do
813 -+ local nicesymlink=${symlink//+(\/)/\/}
814 -+ [[ ${nicesymlink} == /* ]] || die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
815 -+ [[ ${nicesymlink} == */ ]] && die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
816 -+
817 -+ oldsymlinks+=( "${nicesymlink}" )
818 -+ done < <(LC_ALL=C sort -r -u -z "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list")
819 -+ [[ ${#oldsymlinks[@]} -gt 0 ]] || die "${dieprefix}: old provider ${oldcur} does not provide any symlinks?"
820 -+
821 -+ elif [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list || -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
822 -+ die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list is not a file"
823 -+ fi
824 -+
825 -+ local pass errors=
826 -+ for pass in check perform; do
827 -+ local -i new_i=0 old_i=0
828 -+ while [[ -n ${newsymlinks[new_i]} || -n ${oldsymlinks[old_i]} ]]; do
829 -+
830 -+ if ( LC_ALL=C; [[ ${newsymlinks[new_i]} < ${oldsymlinks[old_i]} ]] ); then
831 -+ if [[ ${pass} == check ]]; then
832 -+ if [[ -L ${EROOT}${oldsymlinks[old_i]} ]]; then
833 -+ :
834 -+ elif [[ -d ${EROOT}${oldsymlinks[old_i]} ]]; then
835 -+ write_error_msg "Can't remove ${EROOT}${oldsymlinks[old_i]}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
836 -+ errors=yes
837 -+ elif [[ -e ${EROOT}${oldsymlinks[old_i]} ]]; then
838 -+ if [[ -n ${force} ]]; then
839 -+ write_warning_msg "Removing ${EROOT}${oldsymlinks[old_i]} due to --force: is not a symlink"
840 -+ else
841 -+ write_error_msg "Refusing to remove ${EROOT}${oldsymlinks[old_i]}: is not a symlink (use --force to override)"
842 -+ errors=yes
843 -+ fi
844 -+ fi
845 -+
846 -+ elif [[ ${pass} == perform ]]; then
847 -+ rm -f "${ROOT}${oldsymlinks[old_i]}" || die "${dieprefix}: rm failed"
848 -+ else
849 -+ die "${dieprefix}: unknown \${pass} ${pass}???"
850 -+ fi
851 -+
852 -+ old_i+=1
853 -+
854 -+ else
855 -+ local target=${ALTERNATIVESDIR_ROOTLESS#/}/${ALTERNATIVE}/_current${newsymlinks[new_i]} dir=${newsymlinks[new_i]%/*}
856 -+ while [[ -n ${dir} ]]; do
857 -+ target=../${target}
858 -+ dir=${dir%/*}
859 -+ done
860 -+
861 -+ if [[ ${pass} == check ]]; then
862 -+ if [[ -L ${EROOT}${newsymlinks[new_i]} ]]; then
863 -+ :
864 -+ elif [[ -d ${EROOT}${newsymlinks[new_i]} ]]; then
865 -+ write_error_msg "Can't overwrite ${EROOT}${newsymlinks[new_i]}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
866 -+ errors=yes
867 -+ elif [[ -e ${EROOT}${newsymlinks[new_i]} ]]; then
868 -+ if [[ -n ${force} ]]; then
869 -+ write_warning_msg "Overwriting ${EROOT}${newsymlinks[new_i]} due to --force: is not a symlink"
870 -+ else
871 -+ write_error_msg "Refusing to overwrite ${EROOT}${newsymlinks[new_i]}: is not a symlink (use --force to override)"
872 -+ errors=yes
873 -+ fi
874 -+ fi
875 -+
876 -+ elif [[ ${pass} == perform ]]; then
877 -+ mkdir -p "${EROOT}${newsymlinks[new_i]%/*}" || die "${dieprefix}: mkdir -p failed"
878 -+ ln -snf "${target#/}" "${EROOT}${newsymlinks[new_i]}" || die "${dieprefix}: ln -snf failed"
879 -+ else
880 -+ die "${dieprefix}: unknown \${pass} ${pass}???"
881 -+ fi
882 -+
883 -+ [[ ${newsymlinks[new_i]} == ${oldsymlinks[old_i]} ]] && old_i+=1
884 -+ new_i+=1
885 -+ fi
886 -+ done
887 -+
888 -+ [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
889 -+ done
890 -+
891 -+ local oldcur="$(get_current_provider)"
892 -+ ln -snf "${provider}" "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: ln -snf failed"
893 -+
894 -+ : >"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: emptying/creating _current_list failed"
895 -+ for symlink in "${newsymlinks[@]}"; do
896 -+ echo -n -e "${symlink}\\0" >>"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: appending ${symlink} to _current_list failed"
897 -+ done
898 -+ return 0
899 -+}
900 -+
901 -+_options_parameters() {
902 -+ [[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
903 -+ local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
904 -+ if is_function ${describe_func}; then
905 -+ IFS=$'\n'
906 -+ options=( $(${describe_func}) )
907 -+ IFS=$oldifs
908 -+ for opt in "${options[@]}"; do
909 -+ [[ ${opt} == --* ]] || continue
910 -+ if [[ -n ${descriptions} ]]; then
911 -+ echo "${opt/ : /:}"
912 -+ else
913 -+ echo "${opt%% : *}"
914 -+ fi
915 -+ done
916 -+ fi
917 -+}
918 -+
919 -+options_set() {
920 -+ _options_parameters $FUNCNAME "$@"
921 -+ get_providers
922 -+}
923 -+
924 -+### update action ###
925 -+
926 -+describe_update() {
927 -+ echo "Set a default provider if no valid one currently exists"
928 -+}
929 -+
930 -+describe_update_parameters() {
931 -+ echo "[--ignore] <provider>"
932 -+}
933 -+
934 -+describe_update_options() {
935 -+ echo "--ignore : update to any valid provider EXCEPT the specified provider"
936 -+ echo "<provider> : the name of the provider to use"
937 -+}
938 -+
939 -+do_update() {
940 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
941 -+
942 -+ local p cur=$(get_current_provider) providers=( $(get_providers) ) ignore
943 -+ if [[ "--ignore" == ${1} ]] ; then
944 -+ # Try everything except setting the provider to the given
945 -+ # one. So, if it isn't the given one, we end up doing
946 -+ # nothing. Bug #128
947 -+ shift
948 -+ ignore=${1}
949 -+ fi
950 -+
951 -+ if [[ ${cur} == ${1} && -z ${ignore} ]]; then
952 -+ # if current provider was just updated, reselect it since it could have changed
953 -+ do_set "${cur}" && return 0
954 -+ elif [[ -n ${cur} && ${cur} != ${ignore} ]] ; then
955 -+ # verify existing provider's symlinks
956 -+ local p= bad=0
957 -+ while read -r -d '' p ; do
958 -+ [[ -L "${EROOT}${p}" && -e "${EROOT}${p}" ]] || (( bad++ ))
959 -+ done < "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
960 -+
961 -+ [[ "${bad}" -eq 0 ]] && return 0
962 -+ # fix existing provider if possible
963 -+ has "${cur}" "${providers[@]}" && do_set "${cur}" && return 0
964 -+ elif has "${1}" "${providers[@]}" && [[ -z ${ignore} ]] ; then
965 -+ # switch to new provider if none was set before or it can't be fixed
966 -+ do_set "${1}" && return 0
967 -+ fi
968 -+
969 -+ # if no valid provider has been selected switch to first available, valid
970 -+ # provider, sorted according to importance
971 -+ for p in "${providers[@]}"; do
972 -+ [[ ${ignore} != ${p} ]] && do_set "${p}" && return 0
973 -+ done
974 -+
975 -+ # if a provider is set but no providers are available anymore cleanup
976 -+ cur=$(get_current_provider)
977 -+ if [[ -n ${cur} ]]; then
978 -+ do_unset "${cur}" && return 2
979 -+ fi
980 -+ # if no provider is set and none are available that are not ignored, return 2 for cleanup
981 -+ [[ -z ${providers[@]} || ${providers[@]} == ${ignore} ]] && return 2
982 -+
983 -+ # we tried everything to select a valid provider, but failed
984 -+ return 1
985 -+}
986 -+
987 -+options_update() {
988 -+ _options_parameters $FUNCNAME "$@"
989 -+ get_providers
990 -+}
991 -+
992 -+### unset action ###
993 -+
994 -+describe_unset() {
995 -+ echo "Unset any symlinks created for the current provider for ${ALTERNATIVE}."
996 -+}
997 -+
998 -+describe_unset_parameters() {
999 -+ echo "[ --force ]"
1000 -+}
1001 -+
1002 -+describe_unset_options() {
1003 -+ echo "--force : remove existing non-symlink files (but not directories) if necessary"
1004 -+}
1005 -+
1006 -+do_unset() {
1007 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1008 -+
1009 -+ local force=
1010 -+ if [[ ${1} == --force ]]; then
1011 -+ force=yes
1012 -+ shift
1013 -+ fi
1014 -+
1015 -+ local cur="$(get_current_provider)" p=
1016 -+ [[ -n "${cur}" ]] || die -q "Nothing to unset"
1017 -+ local dieprefix="Could not unset provider for ${ALTERNATIVE}"
1018 -+
1019 -+ local one=false symlink pass errors=
1020 -+ for pass in check perform; do
1021 -+ while read -r -d '' symlink; do
1022 -+ one=true
1023 -+ if [[ ${pass} == check ]]; then
1024 -+ if [[ -L ${EROOT}${symlink} ]]; then
1025 -+ :
1026 -+ elif [[ -d ${EROOT}${symlink} ]]; then
1027 -+ write_error_msg "Can't remove ${EROOT}${symlink}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
1028 -+ errors=yes
1029 -+ elif [[ -e ${EROOT}${symlink} ]]; then
1030 -+ if [[ -n ${force} ]]; then
1031 -+ write_warning_msg "Removing ${EROOT}${symlink} due to --force: is not a symlink"
1032 -+ else
1033 -+ write_error_msg "Refusing to remove ${EROOT}${symlink}: is not a symlink (use --force to override)"
1034 -+ errors=yes
1035 -+ fi
1036 -+ fi
1037 -+
1038 -+ elif [[ ${pass} == perform ]]; then
1039 -+ rm -f "${EROOT}${symlink}" || die "${dieprefix}: rm failed"
1040 -+ else
1041 -+ die "${dieprefix}: unknown \${pass} ${pass}???"
1042 -+ fi
1043 -+ done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
1044 -+
1045 -+ [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
1046 -+ done
1047 -+
1048 -+ ${one} || die "${dieprefix}: does not provide any symlinks?"
1049 -+
1050 -+ rm "${ALTERNATIVESDIR}/${ALTERNATIVE}"/{_current,_current_list} || die "${dieprefix}: rm failed"
1051 -+}
1052 -+
1053 -+options_unset() {
1054 -+ _options_parameters $FUNCNAME "$@"
1055 -+ get_current_provider
1056 -+}
1057 -+
1058 -+### script action ###
1059 -+
1060 -+describe_script() {
1061 -+ echo "Output an evalable script fragment to set PATH, LD_LIBRARY_PATH and MANPATH to use the specified provider"
1062 -+}
1063 -+
1064 -+describe_script_parameters() {
1065 -+ echo "[--sh | --csh] [<provider>]"
1066 -+}
1067 -+
1068 -+describe_script_options() {
1069 -+ echo "--sh : use Bourne shell syntax (default)"
1070 -+ echo "--csh : use C shell syntax"
1071 -+ echo "<provider> : the provider to use or the index of the provider preceeded by a dash (if not specified, use the system default)"
1072 -+}
1073 -+
1074 -+do_script() {
1075 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1076 -+ local syntax=sh provider providers
1077 -+ if [[ ${1} == --sh ]]; then
1078 -+ shift
1079 -+ elif [[ ${1} == --csh ]]; then
1080 -+ syntax=csh
1081 -+ shift
1082 -+ fi
1083 -+
1084 -+ if [[ ${1} == -+([[:digit:]]) ]]; then
1085 -+ providers=( $(get_providers) )
1086 -+ (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
1087 -+ provider=${providers[${1#-}-1]}
1088 -+ else
1089 -+ provider="${1}"
1090 -+ fi
1091 -+ [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
1092 -+
1093 -+ if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
1094 -+ if is_number ${provider} ; then
1095 -+ providers=( $(get_providers) )
1096 -+ [[ -n ${providers[${1#-}-1]} ]] &&
1097 -+ die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
1098 -+ fi
1099 -+ die -q "The given provider (${provider}) does not exist"
1100 -+ fi
1101 -+
1102 -+ local variables=( PATH LD_LIBRARY_PATH MANPATH )
1103 -+ [[ -n ${!default_*} ]] && local ${!default_*}
1104 -+ local default_LD_LIBRARY_PATH=$(grep '^[^#]' "${EROOT}"/etc/ld.so.conf | tr '\n' ':')/lib:/usr/lib
1105 -+ local default_MANPATH=$(MANPATH= man -C"${EROOT}"/etc/man.conf -w)
1106 -+
1107 -+ local var IFS=:
1108 -+ for var in "${variables[@]}"; do
1109 -+ local defvar=default_${var} path paths=( )
1110 -+ for path in ${!var}; do
1111 -+ [[ ${path} == ${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/* ]] && continue
1112 -+ [[ -n ${provider} && -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
1113 -+ paths+=( "${path}" )
1114 -+ done
1115 -+
1116 -+ [[ -n ${provider} ]] && for path in ${!defvar}; do
1117 -+ [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
1118 -+ done
1119 -+
1120 -+ local newval=${paths[*]}
1121 -+ if [[ ${newval} != ${!var} ]]; then
1122 -+ newval=${newval//\'/\'\\\'\'}
1123 -+ if [[ ${syntax} == sh ]]; then
1124 -+ echo "${var}='${newval}'; export ${var}"
1125 -+ else
1126 -+ echo "setenv ${var} '${newval}'"
1127 -+ fi
1128 -+ fi
1129 -+ done
1130 -+}
1131 -+
1132 -+options_script() {
1133 -+ _options_parameters $FUNCNAME "$@"
1134 -+ get_providers
1135 -+}
1136 -+
1137 -+# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :
1138
1139 diff --git a/app-admin/eselect/files/eselect-alternatives.patch b/app-admin/eselect/files/eselect-alternatives.patch
1140 deleted file mode 100644
1141 index 13f0593..0000000
1142 --- a/app-admin/eselect/files/eselect-alternatives.patch
1143 +++ /dev/null
1144 @@ -1,618 +0,0 @@
1145 -Index: bin/eselect.in
1146 -===================================================================
1147 ---- bin/eselect.in (revision 863)
1148 -+++ bin/eselect.in (working copy)
1149 -@@ -22,10 +22,15 @@
1150 - # Where are modules installed by default?
1151 - ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
1152 -
1153 -+# Where are auto-generated modules placed? (e.g. from alternatives-2.eclass)
1154 -+ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
1155 -+
1156 - # Look in these places for modules
1157 --ESELECT_MODULES_PATH=( \
1158 -- "${HOME}/.eselect/modules" \
1159 -- "${ESELECT_DEFAULT_MODULES_PATH}" )
1160 -+ESELECT_MODULES_PATH=(
1161 -+ "${HOME}/.eselect/modules"
1162 -+ "${ESELECT_DEFAULT_MODULES_PATH}"
1163 -+ "${ESELECT_AUTO_GENERATED_MODULES_PATH}"
1164 -+)
1165 -
1166 - # Look in this place for libraries
1167 - ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
1168 -Index: bin/Makefile.am
1169 -===================================================================
1170 ---- bin/Makefile.am (revision 863)
1171 -+++ bin/Makefile.am (working copy)
1172 -@@ -4,6 +4,7 @@
1173 - dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
1174 - -e 's,\@DATADIR\@,$(datadir),g' \
1175 - -e 's,\@EPREFIX\@,$(EPREFIX),g' \
1176 -+ -e 's,\@LIBEXECDIR\@,$(datadir),g' \
1177 - -e 's,\@VERSION\@,$(VERSION),g'
1178 -
1179 - % : %.in
1180 -Index: libs/Makefile.am
1181 -===================================================================
1182 ---- libs/Makefile.am (revision 863)
1183 -+++ libs/Makefile.am (working copy)
1184 -@@ -1,6 +1,7 @@
1185 - eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
1186 -
1187 - eselectlibs_DATA = \
1188 -+ alternatives.bash \
1189 - config.bash \
1190 - core.bash \
1191 - default.eselect \
1192 -@@ -14,6 +15,7 @@
1193 - tests.bash
1194 -
1195 - EXTRA_DIST = \
1196 -+ alternatives.bash.in \
1197 - config.bash.in \
1198 - core.bash.in \
1199 - default.eselect.in \
1200 -@@ -30,7 +32,8 @@
1201 - -e 's,\@SED\@,@SED@,g' \
1202 - -e 's,\@PORTAGEQ\@,@PORTAGEQ@,g' \
1203 - -e 's,\@ENV_UPDATE\@,@ENV_UPDATE@,g' \
1204 -- -e 's,\@CANONICALISE\@,@CANONICALISE@,g'
1205 -+ -e 's,\@CANONICALISE\@,@CANONICALISE@,g' \
1206 -+ -e 's,\@sysconfdir\@,@sysconfdir@,g'
1207 -
1208 - %.bash : %.bash.in
1209 - @$(dosed) $< > $@
1210 ---- libs/alternatives.bash.in.orig 1970-01-01 01:00:00.000000000 +0100
1211 -+++ libs/alternatives.bash.in 2011-09-06 18:55:43.000000000 +0100
1212 -@@ -0,0 +1,550 @@
1213 -+# Copyright 2008 Mike Kelly
1214 -+# Copyright 2009 David Leverton
1215 -+# Copyright 2010 Bo Ørsted Andresen
1216 -+# 2010: Adapted to eselect Sebastien Fabbro (who doesn't like copyrights)
1217 -+# Distributed under the terms of the GNU General Public License v2
1218 -+
1219 -+inherit config output path-manipulation
1220 -+
1221 -+ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
1222 -+ALTERNATIVESDIR="${EROOT}${ALTERNATIVESDIR_ROOTLESS}"
1223 -+
1224 -+get_current_provider() {
1225 -+ local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
1226 -+ if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
1227 -+ local provider=$(readlink "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: readlink ${symlink} failed")
1228 -+ [[ ${provider} == */* ]] && die "${dieprefix}: malformed target for ${symlink}"
1229 -+
1230 -+ if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ||
1231 -+ ( -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} && ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ) ]]; then
1232 -+ die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} is not a directory"
1233 -+ fi
1234 -+
1235 -+ echo "${provider}"
1236 -+
1237 -+ elif [[ -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
1238 -+ die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current is not a symlink"
1239 -+ fi
1240 -+}
1241 -+
1242 -+compare_importance() {
1243 -+ local IFS=.
1244 -+ local a=( ${1} ) b=( ${2} )
1245 -+ local -i i=0
1246 -+ while (( i<${#a[@]} && i<${#b[@]} )); do
1247 -+ if (( a[i]<b[i] )); then
1248 -+ return 0
1249 -+ elif (( a[i]>b[i] )); then
1250 -+ return 1
1251 -+ fi
1252 -+ i+=1
1253 -+ done
1254 -+ (( i<${#b[@]} ))
1255 -+}
1256 -+
1257 -+sort_providers() {
1258 -+ local begin=${1:-0}
1259 -+ local count=${2:-${#providers[@]}}
1260 -+ [[ ${count} -le 1 ]] && return 0
1261 -+ sort_providers ${begin} $((count/2))
1262 -+ sort_providers $((begin+count/2)) $((count-count/2))
1263 -+ local left=( "${providers[@]:begin:count/2}" )
1264 -+ local right=( "${providers[@]:begin+count/2:count-count/2}" )
1265 -+ local -i x i=0 j=0
1266 -+ for (( x=begin; x<begin+count; ++x )); do
1267 -+ if (( j>=${#right[@]} )) || { (( i<${#left[@]} )) && compare_importance "${left[i]%%:*}" "${right[j]%%:*}"; }; then
1268 -+ providers[x]=${left[i++]}
1269 -+ else
1270 -+ providers[x]=${right[j++]}
1271 -+ fi
1272 -+ done
1273 -+}
1274 -+
1275 -+get_providers() {
1276 -+ local p= importance providers=()
1277 -+ for p in "${ALTERNATIVESDIR}/${ALTERNATIVE}"/* ; do
1278 -+ [[ -d ${p} && ! -L ${p} ]] || continue
1279 -+ p=${p##*/}
1280 -+
1281 -+ importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
1282 -+ importance=${importance:-0}
1283 -+ [[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
1284 -+
1285 -+ providers+=( "${importance}:${p}" )
1286 -+ done
1287 -+
1288 -+ sort_providers
1289 -+ for (( p=${#providers[@]}-1 ; p>=0 ; --p )); do
1290 -+ echo "${providers[p]#*:}"
1291 -+ done
1292 -+}
1293 -+
1294 -+### show action ###
1295 -+describe_show() {
1296 -+ echo "Show the current provider in use for ${ALTERNATIVE}"
1297 -+}
1298 -+
1299 -+do_show() {
1300 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1301 -+ local current="$(get_current_provider)"
1302 -+ if [[ -z "${current}" ]] ; then
1303 -+ echo "(none)"
1304 -+ return 2
1305 -+ fi
1306 -+ echo "${current}"
1307 -+}
1308 -+
1309 -+options_show() {
1310 -+ :
1311 -+}
1312 -+
1313 -+### list action ###
1314 -+describe_list() {
1315 -+ echo "Lists all available providers for ${ALTERNATIVE}"
1316 -+}
1317 -+
1318 -+do_list() {
1319 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1320 -+ local n cur= providers=( $(get_providers) )
1321 -+ write_list_start "Available providers for ${ALTERNATIVE}:"
1322 -+
1323 -+ cur="$(get_current_provider)"
1324 -+
1325 -+ if [[ -n "${providers[@]}" ]] ; then
1326 -+ for (( n = 0 ; n < ${#providers[@]} ; ++n )) ; do
1327 -+ [[ ${cur} == "${providers[${n}]}" ]] && \
1328 -+ providers[${n}]="${providers[${n}]} $(highlight '*')"
1329 -+ done
1330 -+ write_numbered_list "${providers[@]}"
1331 -+ else
1332 -+ write_kv_list_entry "(none found)" ""
1333 -+ fi
1334 -+}
1335 -+
1336 -+options_list() {
1337 -+ :
1338 -+}
1339 -+
1340 -+### files action ###
1341 -+describe_files() {
1342 -+ echo "Lists symlinks provided by the currently selected provider"
1343 -+}
1344 -+
1345 -+do_files() {
1346 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1347 -+
1348 -+ local cur="$(get_current_provider)" p=
1349 -+ [[ -n "${cur}" ]] || die -q "No selected provider, hence no symlinks provided"
1350 -+ local dieprefix="Could not list symlinks provided for ${ALTERNATIVE}"
1351 -+
1352 -+ local errors symlink rootsymlink
1353 -+ while read -r -d '' symlink; do
1354 -+ rootsymlink="${EROOT}${symlink}"
1355 -+ rootsymlink=${rootsymlink//+(\/)/\/}
1356 -+ echo "${rootsymlink}"
1357 -+ if [[ -L ${rootsymlink} ]]; then
1358 -+ if [[ ! -e ${rootsymlink} ]]; then
1359 -+ write_error_msg "${rootsymlink} is dangling symlink"
1360 -+ errors=yes
1361 -+ fi
1362 -+ elif [[ -d ${rootsymlink} ]]; then
1363 -+ write_error_msg "${rootsymlink} is a directory"
1364 -+ errors=yes
1365 -+ elif [[ -e ${rootsymlink} ]]; then
1366 -+ write_error_msg "${rootsymlink} exists but is not a symlink"
1367 -+ errors=yes
1368 -+ else
1369 -+ write_error_msg "${rootsymlink} does not exist"
1370 -+ errors=yes
1371 -+ fi
1372 -+ done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
1373 -+}
1374 -+
1375 -+options_files() {
1376 -+ :
1377 -+}
1378 -+
1379 -+### set action ###
1380 -+
1381 -+describe_set() {
1382 -+ echo "Sets a provider for ${ALTERNATIVE}"
1383 -+}
1384 -+
1385 -+describe_set_parameters() {
1386 -+ echo "[ --force ] <provider>"
1387 -+}
1388 -+
1389 -+describe_set_options() {
1390 -+ echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
1391 -+ echo "<provider> : the name of the provider to use or the index of the provider preceeded by a dash"
1392 -+}
1393 -+
1394 -+do_set() {
1395 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1396 -+
1397 -+ local force provider providers
1398 -+ if [[ ${1} == --force ]]; then
1399 -+ force=yes
1400 -+ shift
1401 -+ fi
1402 -+
1403 -+ if [[ ${1} == -+([[:digit:]]) ]]; then
1404 -+ providers=( $(get_providers) )
1405 -+ (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
1406 -+ provider=${providers[${1#-}-1]}
1407 -+ else
1408 -+ provider="${1}"
1409 -+ fi
1410 -+ [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
1411 -+ local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
1412 -+
1413 -+ if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
1414 -+ if is_number ${provider} ; then
1415 -+ providers=( $(get_providers) )
1416 -+ [[ -n ${providers[${1#-}-1]} ]] &&
1417 -+ die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
1418 -+ fi
1419 -+ die -q "The given provider (${provider}) does not exist"
1420 -+ fi
1421 -+
1422 -+ local symlink newsymlinks=() oldsymlinks=()
1423 -+
1424 -+ while read -r -d '' symlink; do
1425 -+ local nicesymlink=${symlink#.}
1426 -+ nicesymlink=${nicesymlink//+(\/)/\/}
1427 -+ [[ ${nicesymlink} == /* ]] || die "${dieprefix}: bad symlink ${symlink}?"
1428 -+ [[ ${nicesymlink} == */ ]] && die "${dieprefix}: bad symlink ${symlink}?"
1429 -+
1430 -+ newsymlinks+=( "${nicesymlink}" )
1431 -+ done < <(
1432 -+ cd "${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}" || die "${dieprefix}: cd failed"
1433 -+ find . -type l -print0 | LC_ALL=C sort -r -u -z)
1434 -+ [[ ${#newsymlinks[@]} -gt 0 ]] || die "${dieprefix}: does not provide any symlinks?"
1435 -+
1436 -+ if [[ -f ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
1437 -+ while read -r -d '' symlink; do
1438 -+ local nicesymlink=${symlink//+(\/)/\/}
1439 -+ [[ ${nicesymlink} == /* ]] || die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
1440 -+ [[ ${nicesymlink} == */ ]] && die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
1441 -+
1442 -+ oldsymlinks+=( "${nicesymlink}" )
1443 -+ done < <(LC_ALL=C sort -r -u -z "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list")
1444 -+ [[ ${#oldsymlinks[@]} -gt 0 ]] || die "${dieprefix}: old provider ${oldcur} does not provide any symlinks?"
1445 -+
1446 -+ elif [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list || -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
1447 -+ die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list is not a file"
1448 -+ fi
1449 -+
1450 -+ local pass errors=
1451 -+ for pass in check perform; do
1452 -+ local -i new_i=0 old_i=0
1453 -+ while [[ -n ${newsymlinks[new_i]} || -n ${oldsymlinks[old_i]} ]]; do
1454 -+
1455 -+ if ( LC_ALL=C; [[ ${newsymlinks[new_i]} < ${oldsymlinks[old_i]} ]] ); then
1456 -+ if [[ ${pass} == check ]]; then
1457 -+ if [[ -L ${EROOT}${oldsymlinks[old_i]} ]]; then
1458 -+ :
1459 -+ elif [[ -d ${EROOT}${oldsymlinks[old_i]} ]]; then
1460 -+ write_error_msg "Can't remove ${EROOT}${oldsymlinks[old_i]}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
1461 -+ errors=yes
1462 -+ elif [[ -e ${EROOT}${oldsymlinks[old_i]} ]]; then
1463 -+ if [[ -n ${force} ]]; then
1464 -+ write_warning_msg "Removing ${EROOT}${oldsymlinks[old_i]} due to --force: is not a symlink"
1465 -+ else
1466 -+ write_error_msg "Refusing to remove ${EROOT}${oldsymlinks[old_i]}: is not a symlink (use --force to override)"
1467 -+ errors=yes
1468 -+ fi
1469 -+ fi
1470 -+
1471 -+ elif [[ ${pass} == perform ]]; then
1472 -+ rm -f "${ROOT}${oldsymlinks[old_i]}" || die "${dieprefix}: rm failed"
1473 -+ else
1474 -+ die "${dieprefix}: unknown \${pass} ${pass}???"
1475 -+ fi
1476 -+
1477 -+ old_i+=1
1478 -+
1479 -+ else
1480 -+ local target=${ALTERNATIVESDIR_ROOTLESS#/}/${ALTERNATIVE}/_current${newsymlinks[new_i]} dir=${newsymlinks[new_i]%/*}
1481 -+ while [[ -n ${dir} ]]; do
1482 -+ target=../${target}
1483 -+ dir=${dir%/*}
1484 -+ done
1485 -+
1486 -+ if [[ ${pass} == check ]]; then
1487 -+ if [[ -L ${EROOT}${newsymlinks[new_i]} ]]; then
1488 -+ :
1489 -+ elif [[ -d ${EROOT}${newsymlinks[new_i]} ]]; then
1490 -+ write_error_msg "Can't overwrite ${EROOT}${newsymlinks[new_i]}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
1491 -+ errors=yes
1492 -+ elif [[ -e ${EROOT}${newsymlinks[new_i]} ]]; then
1493 -+ if [[ -n ${force} ]]; then
1494 -+ write_warning_msg "Overwriting ${EROOT}${newsymlinks[new_i]} due to --force: is not a symlink"
1495 -+ else
1496 -+ write_error_msg "Refusing to overwrite ${EROOT}${newsymlinks[new_i]}: is not a symlink (use --force to override)"
1497 -+ errors=yes
1498 -+ fi
1499 -+ fi
1500 -+
1501 -+ elif [[ ${pass} == perform ]]; then
1502 -+ mkdir -p "${EROOT}${newsymlinks[new_i]%/*}" || die "${dieprefix}: mkdir -p failed"
1503 -+ ln -snf "${target#/}" "${EROOT}${newsymlinks[new_i]}" || die "${dieprefix}: ln -snf failed"
1504 -+ else
1505 -+ die "${dieprefix}: unknown \${pass} ${pass}???"
1506 -+ fi
1507 -+
1508 -+ [[ ${newsymlinks[new_i]} == ${oldsymlinks[old_i]} ]] && old_i+=1
1509 -+ new_i+=1
1510 -+ fi
1511 -+ done
1512 -+
1513 -+ [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
1514 -+ done
1515 -+
1516 -+ local oldcur="$(get_current_provider)"
1517 -+ ln -snf "${provider}" "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: ln -snf failed"
1518 -+
1519 -+ : >"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: emptying/creating _current_list failed"
1520 -+ for symlink in "${newsymlinks[@]}"; do
1521 -+ echo -n -e "${symlink}\\0" >>"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: appending ${symlink} to _current_list failed"
1522 -+ done
1523 -+ return 0
1524 -+}
1525 -+
1526 -+_options_parameters() {
1527 -+ [[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
1528 -+ local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
1529 -+ if is_function ${describe_func}; then
1530 -+ IFS=$'\n'
1531 -+ options=( $(${describe_func}) )
1532 -+ IFS=$oldifs
1533 -+ for opt in "${options[@]}"; do
1534 -+ [[ ${opt} == --* ]] || continue
1535 -+ if [[ -n ${descriptions} ]]; then
1536 -+ echo "${opt/ : /:}"
1537 -+ else
1538 -+ echo "${opt%% : *}"
1539 -+ fi
1540 -+ done
1541 -+ fi
1542 -+}
1543 -+
1544 -+options_set() {
1545 -+ _options_parameters $FUNCNAME "$@"
1546 -+ get_providers
1547 -+}
1548 -+
1549 -+### update action ###
1550 -+
1551 -+describe_update() {
1552 -+ echo "Set a default provider if no valid one currently exists"
1553 -+}
1554 -+
1555 -+describe_update_parameters() {
1556 -+ echo "[--ignore] <provider>"
1557 -+}
1558 -+
1559 -+describe_update_options() {
1560 -+ echo "--ignore : update to any valid provider EXCEPT the specified provider"
1561 -+ echo "<provider> : the name of the provider to use"
1562 -+}
1563 -+
1564 -+do_update() {
1565 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1566 -+
1567 -+ local p cur=$(get_current_provider) providers=( $(get_providers) ) ignore
1568 -+ if [[ "--ignore" == ${1} ]] ; then
1569 -+ # Try everything except setting the provider to the given
1570 -+ # one. So, if it isn't the given one, we end up doing
1571 -+ # nothing. Bug #128
1572 -+ shift
1573 -+ ignore=${1}
1574 -+ fi
1575 -+
1576 -+ if [[ ${cur} == ${1} && -z ${ignore} ]]; then
1577 -+ # if current provider was just updated, reselect it since it could have changed
1578 -+ do_set "${cur}" && return 0
1579 -+ elif [[ -n ${cur} && ${cur} != ${ignore} ]] ; then
1580 -+ # verify existing provider's symlinks
1581 -+ local p= bad=0
1582 -+ while read -r -d '' p ; do
1583 -+ [[ -L "${EROOT}${p}" && -e "${EROOT}${p}" ]] || (( bad++ ))
1584 -+ done < "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
1585 -+
1586 -+ [[ "${bad}" -eq 0 ]] && return 0
1587 -+ # fix existing provider if possible
1588 -+ has "${cur}" "${providers[@]}" && do_set "${cur}" && return 0
1589 -+ elif has "${1}" "${providers[@]}" && [[ -z ${ignore} ]] ; then
1590 -+ # switch to new provider if none was set before or it can't be fixed
1591 -+ do_set "${1}" && return 0
1592 -+ fi
1593 -+
1594 -+ # if no valid provider has been selected switch to first available, valid
1595 -+ # provider, sorted according to importance
1596 -+ for p in "${providers[@]}"; do
1597 -+ [[ ${ignore} != ${p} ]] && do_set "${p}" && return 0
1598 -+ done
1599 -+
1600 -+ # if a provider is set but no providers are available anymore cleanup
1601 -+ cur=$(get_current_provider)
1602 -+ if [[ -n ${cur} ]]; then
1603 -+ do_unset "${cur}" && return 2
1604 -+ fi
1605 -+ # if no provider is set and none are available that are not ignored, return 2 for cleanup
1606 -+ [[ -z ${providers[@]} || ${providers[@]} == ${ignore} ]] && return 2
1607 -+
1608 -+ # we tried everything to select a valid provider, but failed
1609 -+ return 1
1610 -+}
1611 -+
1612 -+options_update() {
1613 -+ _options_parameters $FUNCNAME "$@"
1614 -+ get_providers
1615 -+}
1616 -+
1617 -+### unset action ###
1618 -+
1619 -+describe_unset() {
1620 -+ echo "Unset any symlinks created for the current provider for ${ALTERNATIVE}."
1621 -+}
1622 -+
1623 -+describe_unset_parameters() {
1624 -+ echo "[ --force ]"
1625 -+}
1626 -+
1627 -+describe_unset_options() {
1628 -+ echo "--force : remove existing non-symlink files (but not directories) if necessary"
1629 -+}
1630 -+
1631 -+do_unset() {
1632 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1633 -+
1634 -+ local force=
1635 -+ if [[ ${1} == --force ]]; then
1636 -+ force=yes
1637 -+ shift
1638 -+ fi
1639 -+
1640 -+ local cur="$(get_current_provider)" p=
1641 -+ [[ -n "${cur}" ]] || die -q "Nothing to unset"
1642 -+ local dieprefix="Could not unset provider for ${ALTERNATIVE}"
1643 -+
1644 -+ local one=false symlink pass errors=
1645 -+ for pass in check perform; do
1646 -+ while read -r -d '' symlink; do
1647 -+ one=true
1648 -+ if [[ ${pass} == check ]]; then
1649 -+ if [[ -L ${EROOT}${symlink} ]]; then
1650 -+ :
1651 -+ elif [[ -d ${EROOT}${symlink} ]]; then
1652 -+ write_error_msg "Can't remove ${EROOT}${symlink}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
1653 -+ errors=yes
1654 -+ elif [[ -e ${EROOT}${symlink} ]]; then
1655 -+ if [[ -n ${force} ]]; then
1656 -+ write_warning_msg "Removing ${EROOT}${symlink} due to --force: is not a symlink"
1657 -+ else
1658 -+ write_error_msg "Refusing to remove ${EROOT}${symlink}: is not a symlink (use --force to override)"
1659 -+ errors=yes
1660 -+ fi
1661 -+ fi
1662 -+
1663 -+ elif [[ ${pass} == perform ]]; then
1664 -+ rm -f "${EROOT}${symlink}" || die "${dieprefix}: rm failed"
1665 -+ else
1666 -+ die "${dieprefix}: unknown \${pass} ${pass}???"
1667 -+ fi
1668 -+ done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
1669 -+
1670 -+ [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
1671 -+ done
1672 -+
1673 -+ ${one} || die "${dieprefix}: does not provide any symlinks?"
1674 -+
1675 -+ rm "${ALTERNATIVESDIR}/${ALTERNATIVE}"/{_current,_current_list} || die "${dieprefix}: rm failed"
1676 -+}
1677 -+
1678 -+options_unset() {
1679 -+ _options_parameters $FUNCNAME "$@"
1680 -+ get_current_provider
1681 -+}
1682 -+
1683 -+### script action ###
1684 -+
1685 -+describe_script() {
1686 -+ echo "Output an evalable script fragment to set PATH, LD_LIBRARY_PATH and MANPATH to use the specified provider"
1687 -+}
1688 -+
1689 -+describe_script_parameters() {
1690 -+ echo "[--sh | --csh] [<provider>]"
1691 -+}
1692 -+
1693 -+describe_script_options() {
1694 -+ echo "--sh : use Bourne shell syntax (default)"
1695 -+ echo "--csh : use C shell syntax"
1696 -+ echo "<provider> : the provider to use or the index of the provider preceeded by a dash (if not specified, use the system default)"
1697 -+}
1698 -+
1699 -+do_script() {
1700 -+ [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
1701 -+ local syntax=sh provider providers
1702 -+ if [[ ${1} == --sh ]]; then
1703 -+ shift
1704 -+ elif [[ ${1} == --csh ]]; then
1705 -+ syntax=csh
1706 -+ shift
1707 -+ fi
1708 -+
1709 -+ if [[ ${1} == -+([[:digit:]]) ]]; then
1710 -+ providers=( $(get_providers) )
1711 -+ (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
1712 -+ provider=${providers[${1#-}-1]}
1713 -+ else
1714 -+ provider="${1}"
1715 -+ fi
1716 -+ [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
1717 -+
1718 -+ if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
1719 -+ if is_number ${provider} ; then
1720 -+ providers=( $(get_providers) )
1721 -+ [[ -n ${providers[${1#-}-1]} ]] &&
1722 -+ die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
1723 -+ fi
1724 -+ die -q "The given provider (${provider}) does not exist"
1725 -+ fi
1726 -+
1727 -+ local variables=( PATH LD_LIBRARY_PATH MANPATH )
1728 -+ [[ -n ${!default_*} ]] && local ${!default_*}
1729 -+ local default_LD_LIBRARY_PATH=$(grep '^[^#]' "${EROOT}"/etc/ld.so.conf | tr '\n' ':')/lib:/usr/lib
1730 -+ local default_MANPATH=$(MANPATH= man -C"${EROOT}"/etc/man.conf -w)
1731 -+
1732 -+ local var IFS=:
1733 -+ for var in "${variables[@]}"; do
1734 -+ local defvar=default_${var} path paths=( )
1735 -+ for path in ${!var}; do
1736 -+ [[ ${path} == ${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/* ]] && continue
1737 -+ [[ -n ${provider} && -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
1738 -+ paths+=( "${path}" )
1739 -+ done
1740 -+
1741 -+ [[ -n ${provider} ]] && for path in ${!defvar}; do
1742 -+ [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
1743 -+ done
1744 -+
1745 -+ local newval=${paths[*]}
1746 -+ if [[ ${newval} != ${!var} ]]; then
1747 -+ newval=${newval//\'/\'\\\'\'}
1748 -+ if [[ ${syntax} == sh ]]; then
1749 -+ echo "${var}='${newval}'; export ${var}"
1750 -+ else
1751 -+ echo "setenv ${var} '${newval}'"
1752 -+ fi
1753 -+ fi
1754 -+ done
1755 -+}
1756 -+
1757 -+options_script() {
1758 -+ _options_parameters $FUNCNAME "$@"
1759 -+ get_providers
1760 -+}
1761 -+
1762 -+# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :