public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2012-10-07  9:18 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2012-10-07  9:18 UTC (permalink / raw
  To: gentoo-commits

commit:     e7295ec08afc5b4611b1ed7c103d10465e01c1c5
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 15 15:20:14 2012 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sat Sep 15 15:20:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=e7295ec0

app-admin/eselect: Version BUmp

(Portage version: 2.2.0_alpha128/git/Linux x86_64, unsigned Manifest commit)

---
 app-admin/eselect/ChangeLog                       |    6 ++
 app-admin/eselect/eselect-1.3.2-r1.ebuild         |   80 +++++++++++++++++++++
 app-admin/eselect/files/eselect-1.3.2-eroot.patch |   11 +++
 3 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index 99f036e..4ed313a 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+*eselect-1.3.2-r1 (15 Sep 2012)
+
+  15 Sep 2012; Justin Lecher <jlec@gentoo.org> +eselect-1.3.2-r1.ebuild,
+  +files/eselect-1.3.2-eroot.patch:
+  Version BUmp
+
   04 Jun 2012; Justin Lecher <jlec@gentoo.org> eselect-1.3.1-r1.ebuild,
   metadata.xml:
   Fix eaclocal call

diff --git a/app-admin/eselect/eselect-1.3.2-r1.ebuild b/app-admin/eselect/eselect-1.3.2-r1.ebuild
new file mode 100644
index 0000000..90435a2
--- /dev/null
+++ b/app-admin/eselect/eselect-1.3.2-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/eselect-1.3.ebuild,v 1.1 2012/01/21 19:02:55 ulm Exp $
+
+EAPI=3
+
+inherit bash-completion-r1 eutils autotools
+
+DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
+HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc"
+
+RDEPEND="sys-apps/sed
+	|| (
+		sys-apps/coreutils
+		sys-freebsd/freebsd-bin
+		app-misc/realpath
+	)"
+DEPEND="${RDEPEND}
+	app-arch/xz-utils
+	doc? ( dev-python/docutils )"
+RDEPEND="!app-admin/eselect-news
+	${RDEPEND}
+	sys-apps/file
+	sys-libs/ncurses"
+
+# Commented out: only few users of eselect will edit its source
+#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
+#	vim-syntax? ( app-vim/eselect-syntax )"
+
+src_prepare() {
+	epatch "${FILESDIR}/${P}-eroot.patch"
+	epatch "${FILESDIR}"/${PN}-alternatives.patch
+	AT_M4DIR="." eautoreconf
+}
+
+src_compile() {
+	emake || die
+
+	if use doc; then
+		emake html || die
+	fi
+}
+
+src_install() {
+	emake DESTDIR="${D}" install || die
+	newbashcomp misc/${PN}.bashcomp ${PN} || die
+	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt || die
+
+	if use doc; then
+		dohtml *.html doc/* || die
+	fi
+
+	# needed by news module
+	keepdir /var/lib/gentoo/news
+	if ! use prefix; then
+		fowners root:portage /var/lib/gentoo/news || die
+		fperms g+w /var/lib/gentoo/news || die
+	fi
+
+	# band aid for prefix
+	if use prefix; then
+		cd "${ED}"/usr/share/eselect/libs
+		sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash
+	fi
+}
+
+pkg_postinst() {
+	# fowners in src_install doesn't work for the portage group:
+	# merging changes the group back to root
+	if ! use prefix; then
+		chgrp portage "${EROOT}/var/lib/gentoo/news" \
+			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+	fi
+}

diff --git a/app-admin/eselect/files/eselect-1.3.2-eroot.patch b/app-admin/eselect/files/eselect-1.3.2-eroot.patch
new file mode 100644
index 0000000..81e5bb6
--- /dev/null
+++ b/app-admin/eselect/files/eselect-1.3.2-eroot.patch
@@ -0,0 +1,11 @@
+--- a/bin/eselect.in
++++ b/bin/eselect.in
+@@ -43,7 +43,7 @@
+ 
+ # Support variables for Gentoo Prefix
+ EPREFIX="@EPREFIX@"
+-EROOT="${ROOT%/}${EPREFIX}"
++EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
+ 
+ # Remove all alias definitions. Unset functions and variables that are
+ # known to cause trouble.


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2018-04-02 11:20 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2018-04-02 11:20 UTC (permalink / raw
  To: gentoo-commits

commit:     ac70acdea0ea072525ac9d64ba1b55e8939008cb
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  2 11:18:17 2018 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Apr  2 11:20:24 2018 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=ac70acde

app-admin/eselect: Version Bump

Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
Package-Manager: Portage-2.3.27, Repoman-2.3.9

 .../{eselect-1.4.10-r100.ebuild => eselect-1.4.12-r100.ebuild}      | 6 +++---
 app-admin/eselect/eselect-9999.ebuild                               | 4 ++--
 ...-1.4.10-alternatives.patch => eselect-1.4.12-alternatives.patch} | 0
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app-admin/eselect/eselect-1.4.10-r100.ebuild b/app-admin/eselect/eselect-1.4.12-r100.ebuild
similarity index 91%
rename from app-admin/eselect/eselect-1.4.10-r100.ebuild
rename to app-admin/eselect/eselect-1.4.12-r100.ebuild
index bafbb5e10..602a3c8e8 100644
--- a/app-admin/eselect/eselect-1.4.10-r100.ebuild
+++ b/app-admin/eselect/eselect-1.4.12-r100.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -6,8 +6,8 @@ EAPI=6
 inherit autotools eutils bash-completion-r1
 
 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
-SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Eselect"
+SRC_URI="https://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
 
 LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-3.0 )"
 SLOT="0"

diff --git a/app-admin/eselect/eselect-9999.ebuild b/app-admin/eselect/eselect-9999.ebuild
index b55f9fb64..8cae96147 100644
--- a/app-admin/eselect/eselect-9999.ebuild
+++ b/app-admin/eselect/eselect-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -6,7 +6,7 @@ EAPI=6
 inherit autotools git-r3 bash-completion-r1
 
 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Eselect"
 EGIT_REPO_URI="git://github.com/gentoo-science/eselect.git"
 EGIT_BRANCH="alternatives"
 

diff --git a/app-admin/eselect/files/eselect-1.4.10-alternatives.patch b/app-admin/eselect/files/eselect-1.4.12-alternatives.patch
similarity index 100%
rename from app-admin/eselect/files/eselect-1.4.10-alternatives.patch
rename to app-admin/eselect/files/eselect-1.4.12-alternatives.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2017-12-25 20:33 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2017-12-25 20:33 UTC (permalink / raw
  To: gentoo-commits

commit:     0da2d72d32955c16fe527ad3119522ea03af8962
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 25 20:32:47 2017 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Dec 25 20:32:47 2017 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=0da2d72d

app-admin/eselect: Version Bump

Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
Package-Manager: Portage-2.3.19, Repoman-2.3.6

 .../eselect/{eselect-1.4.9-r100.ebuild => eselect-1.4.10-r100.ebuild}     | 0
 ...eselect-1.4.9-alternatives.patch => eselect-1.4.10-alternatives.patch} | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/app-admin/eselect/eselect-1.4.9-r100.ebuild b/app-admin/eselect/eselect-1.4.10-r100.ebuild
similarity index 100%
rename from app-admin/eselect/eselect-1.4.9-r100.ebuild
rename to app-admin/eselect/eselect-1.4.10-r100.ebuild

diff --git a/app-admin/eselect/files/eselect-1.4.9-alternatives.patch b/app-admin/eselect/files/eselect-1.4.10-alternatives.patch
similarity index 100%
rename from app-admin/eselect/files/eselect-1.4.9-alternatives.patch
rename to app-admin/eselect/files/eselect-1.4.10-alternatives.patch


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2017-04-30  7:47 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2017-04-30  7:47 UTC (permalink / raw
  To: gentoo-commits

commit:     364699086090e3f7f02d3e6daec9f8aee232c4aa
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 30 07:45:29 2017 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sun Apr 30 07:46:58 2017 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=36469908

app-admin/eselect: Update to latest upstream release

Package-Manager: Portage-2.3.5, Repoman-2.3.2
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../eselect/{eselect-1.4.8-r100.ebuild => eselect-1.4.9-r100.ebuild}    | 2 +-
 ...select-1.4.8-alternatives.patch => eselect-1.4.9-alternatives.patch} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/app-admin/eselect/eselect-1.4.8-r100.ebuild b/app-admin/eselect/eselect-1.4.9-r100.ebuild
similarity index 97%
rename from app-admin/eselect/eselect-1.4.8-r100.ebuild
rename to app-admin/eselect/eselect-1.4.9-r100.ebuild
index bf6228baf..bafbb5e10 100644
--- a/app-admin/eselect/eselect-1.4.8-r100.ebuild
+++ b/app-admin/eselect/eselect-1.4.9-r100.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6

diff --git a/app-admin/eselect/files/eselect-1.4.8-alternatives.patch b/app-admin/eselect/files/eselect-1.4.9-alternatives.patch
similarity index 100%
rename from app-admin/eselect/files/eselect-1.4.8-alternatives.patch
rename to app-admin/eselect/files/eselect-1.4.9-alternatives.patch


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2016-12-10 10:50 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2016-12-10 10:50 UTC (permalink / raw
  To: gentoo-commits

commit:     e6c2d58871a6a2270cef983c00fcb9301f88f08a
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 10:50:41 2016 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 10:50:41 2016 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=e6c2d588

app-admin/eselect: Version Bump

Package-Manager: portage-2.3.3
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../eselect/{eselect-1.4.7-r100.ebuild => eselect-1.4.8-r100.ebuild}      | 0
 ...{eselect-1.4.7-alternatives.patch => eselect-1.4.8-alternatives.patch} | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/app-admin/eselect/eselect-1.4.7-r100.ebuild b/app-admin/eselect/eselect-1.4.8-r100.ebuild
similarity index 100%
rename from app-admin/eselect/eselect-1.4.7-r100.ebuild
rename to app-admin/eselect/eselect-1.4.8-r100.ebuild

diff --git a/app-admin/eselect/files/eselect-1.4.7-alternatives.patch b/app-admin/eselect/files/eselect-1.4.8-alternatives.patch
similarity index 100%
rename from app-admin/eselect/files/eselect-1.4.7-alternatives.patch
rename to app-admin/eselect/files/eselect-1.4.8-alternatives.patch


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2016-07-31 16:09 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2016-07-31 16:09 UTC (permalink / raw
  To: gentoo-commits

commit:     14543cbf2cb2404de29891a26452c755ca273521
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 31 15:12:32 2016 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sun Jul 31 15:12:32 2016 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=14543cbf

app-admin/eselect: Version Bump

fixes gentoo-science/sci#637

Package-Manager: portage-2.3.0
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../eselect/{eselect-1.4.5-r103.ebuild => eselect-1.4.6-r100.ebuild}      | 0
 ...{eselect-1.4.5-alternatives.patch => eselect-1.4.6-alternatives.patch} | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/app-admin/eselect/eselect-1.4.5-r103.ebuild b/app-admin/eselect/eselect-1.4.6-r100.ebuild
similarity index 100%
rename from app-admin/eselect/eselect-1.4.5-r103.ebuild
rename to app-admin/eselect/eselect-1.4.6-r100.ebuild

diff --git a/app-admin/eselect/files/eselect-1.4.5-alternatives.patch b/app-admin/eselect/files/eselect-1.4.6-alternatives.patch
similarity index 100%
rename from app-admin/eselect/files/eselect-1.4.5-alternatives.patch
rename to app-admin/eselect/files/eselect-1.4.6-alternatives.patch


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2015-08-14  7:24 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2015-08-14  7:24 UTC (permalink / raw
  To: gentoo-commits

commit:     cc3b0551f9e2713929aeb12c9556b32c18d6bfbd
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 14 07:24:02 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Fri Aug 14 07:24:02 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=cc3b0551

app-admin/eselect: Update Patch

Package-Manager: portage-2.2.20
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 app-admin/eselect/ChangeLog                        |   4 +
 .../eselect/files/eselect-1.4.5-alternatives.patch | 260 +++++++++++++++------
 2 files changed, 187 insertions(+), 77 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index d3c8e3e..ee09f06 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+  14 Aug 2015; Justin Lecher <jlec@gentoo.org>
+  files/eselect-1.4.5-alternatives.patch:
+  app-admin/eselect: Update Patch
+
 *eselect-1.4.5-r100 (14 Aug 2015)
 
   14 Aug 2015; Justin Lecher <jlec@gentoo.org> +eselect-1.4.5-r100.ebuild,

diff --git a/app-admin/eselect/files/eselect-1.4.5-alternatives.patch b/app-admin/eselect/files/eselect-1.4.5-alternatives.patch
index b2b9432..8296aa1 100644
--- a/app-admin/eselect/files/eselect-1.4.5-alternatives.patch
+++ b/app-admin/eselect/files/eselect-1.4.5-alternatives.patch
@@ -1,27 +1,52 @@
+ bin/Makefile.am                  |   1 +
+ bin/eselect.in                   | 150 +++++++++++-
+ libs/Makefile.am                 |   7 +-
+ libs/alternatives-common.bash.in | 509 +++++++++++++++++++++++++++++++++++++++
+ libs/alternatives.bash.in        | 316 ++++++++++++++++++++++++
+ modules/Makefile.am              |   1 +
+ modules/alternatives.eselect     | 178 ++++++++++++++
+ modules/modules.eselect          | 288 ++++++++++++++--------
+ 8 files changed, 1342 insertions(+), 108 deletions(-)
+
+diff --git a/bin/Makefile.am b/bin/Makefile.am
+index 20902c1..ad08867 100644
+--- a/bin/Makefile.am
++++ b/bin/Makefile.am
+@@ -4,6 +4,7 @@ EXTRA_DIST = eselect.in
+ dosed = @SED@ -e 's%\@BASH\@%$(BASH)%g' \
+ 	      -e 's%\@DATADIR\@%$(datadir)%g' \
+ 	      -e 's%\@EPREFIX\@%$(EPREFIX)%g' \
++	      -e 's%\@LIBEXECDIR\@%$(datadir)%g' \
+ 	      -e 's%\@VERSION\@%$(VERSION)$(EXTRAVERSION)%g'
+ 
+ % : %.in
 diff --git a/bin/eselect.in b/bin/eselect.in
-index 934a10a..7c1c14b 100755
+index 934a10a..5242ed3 100755
 --- a/bin/eselect.in
 +++ b/bin/eselect.in
-@@ -22,10 +22,15 @@ ESELECT_DATA_PATH="@DATADIR@/eselect"
+@@ -22,10 +22,18 @@ ESELECT_DATA_PATH="@DATADIR@/eselect"
  # Where are modules installed by default?
  ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
  
 +# Where are auto-generated modules placed? (e.g. from alternatives-2.eclass)
 +ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
 +
++# Where the users store their modules
++ESELECT_USER_MODULES_PATH="${ROOT}${HOME}/.eselect/modules"
++
  # Look in these places for modules
 -ESELECT_MODULES_PATH=( \
 -	"${HOME}/.eselect/modules" \
 -	"${ESELECT_DEFAULT_MODULES_PATH}" )
 +ESELECT_MODULES_PATH=(
-+	"${HOME}/.eselect/modules"
++	"${ESELECT_USER_MODULES_PATH}}"
 +	"${ESELECT_DEFAULT_MODULES_PATH}"
 +	"${ESELECT_AUTO_GENERATED_MODULES_PATH}"
 +)
  
  # Look in this place for libraries
  ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
-@@ -64,12 +69,27 @@ fi
+@@ -64,12 +72,27 @@ fi
  # Load core functions
  source "${ESELECT_CORE_PATH}/core.bash" || exit 255
  # Load necessary functions for the main script
@@ -50,7 +75,7 @@ index 934a10a..7c1c14b 100755
  # es_do_usage
  # Display eselect usage
  es_do_usage() {
-@@ -81,14 +101,10 @@ es_do_usage() {
+@@ -81,14 +104,10 @@ es_do_usage() {
  es_do_help() {
  	es_do_usage
  	echo
@@ -67,7 +92,7 @@ index 934a10a..7c1c14b 100755
  }
  
  # es_do_version
-@@ -100,6 +116,114 @@ es_do_version() {
+@@ -100,6 +119,114 @@ es_do_version() {
  	echo "Distributed under the terms of the GNU GPL version 2 or later."
  }
  
@@ -182,7 +207,7 @@ index 934a10a..7c1c14b 100755
  ### main code ###
  
  # figure out what the action is. we need to know whether we're
-@@ -141,6 +265,9 @@ while [[ ${1##--} != "$1" ]]; do
+@@ -141,6 +268,9 @@ while [[ ${1##--} != "$1" ]]; do
  				*) die -q "Invalid argument for ${1%%=*} option" ;;
  			esac
  			;;
@@ -226,17 +251,30 @@ index 027ef73..a5fe373 100644
  	@$(dosed) $< > $@
 diff --git a/libs/alternatives-common.bash.in b/libs/alternatives-common.bash.in
 new file mode 100644
-index 0000000..64d74df
+index 0000000..024d41e
 --- /dev/null
 +++ b/libs/alternatives-common.bash.in
-@@ -0,0 +1,488 @@
-+# Copyright 2015 Gentoo Foundation
-+# Copyright 2008 Mike Kelly
-+# Copyright 2009, 2013 David Leverton
-+# Copyright 2010 Bo Ørsted Andresen
-+# Distributed under the terms of the GNU General Public License v2
+@@ -0,0 +1,509 @@
++# Copyright (c) 2005-2015 Gentoo Foundation
++# Copyright (c) 2008 Mike Kelly
++# Copyright (c) 2009-2013 David Leverton
++# Copyright (c) 2009-2014 Bo Ørsted Andresen
++#
++# This file is part of the 'eselect' tools framework.
++#
++# eselect is free software: you can redistribute it and/or modify it under the
++# terms of the GNU General Public License as published by the Free Software
++# Foundation, either version 2 of the License, or (at your option) any later
++# version.
++#
++# eselect is distributed in the hope that it will be useful, but WITHOUT ANY
++# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
++# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along with
++# eselect.  If not, see <http://www.gnu.org/licenses/>.
 +
-+inherit config output path-manipulation
++inherit config output path-manipulation tests
 +
 +: "${ALTERNATIVESDIR_ROOTLESS:=@sysconfdir@/env.d/alternatives}"
 +ALTERNATIVESDIR="${EROOT%/}${ALTERNATIVESDIR_ROOTLESS}"
@@ -298,7 +336,7 @@ index 0000000..64d74df
 +		[[ -d ${p} && ! -L ${p} ]] || continue
 +		p=${p##*/}
 +
-+		[[ -e "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance" ]] &&
++		[[ -e "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance" ]] && \
 +			importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
 +		importance=${importance:-0}
 +		[[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
@@ -312,6 +350,14 @@ index 0000000..64d74df
 +	done
 +}
 +
++has_provider() {
++	local provider=${1} item providers=( $(get_providers) )
++	for item in  ${providers[@]}; do
++		[[ ${item} == ${provider} ]] && return 0
++	done
++	return 1
++}
++
 +_options_parameters() {
 +	[[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
 +	local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
@@ -720,15 +766,28 @@ index 0000000..64d74df
 +# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :
 diff --git a/libs/alternatives.bash.in b/libs/alternatives.bash.in
 new file mode 100644
-index 0000000..1b5a2b0
+index 0000000..cf4fa36
 --- /dev/null
 +++ b/libs/alternatives.bash.in
-@@ -0,0 +1,293 @@
-+# Copyright 2015 Gentoo Foundation
-+# Copyright 2008 Mike Kelly
-+# Copyright 2009, 2013 David Leverton
-+# Copyright 2010 Bo Ørsted Andresen
-+# Distributed under the terms of the GNU General Public License v2
+@@ -0,0 +1,316 @@
++# Copyright (c) 2005-2015 Gentoo Foundation
++# Copyright (c) 2008 Mike Kelly
++# Copyright (c) 2009-2013 David Leverton
++# Copyright (c) 2009-2014 Bo Ørsted Andresen
++#
++# This file is part of the 'eselect' tools framework.
++#
++# eselect is free software: you can redistribute it and/or modify it under the
++# terms of the GNU General Public License as published by the Free Software
++# Foundation, either version 2 of the License, or (at your option) any later
++# version.
++#
++# eselect is distributed in the hope that it will be useful, but WITHOUT ANY
++# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
++# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along with
++# eselect.  If not, see <http://www.gnu.org/licenses/>.
 +
 +inherit alternatives-common
 +
@@ -878,12 +937,22 @@ index 0000000..1b5a2b0
 +}
 +
 +do_remove() {
++	local ret
 +	alternatives_do_remove
 +
-+#	if no provider is present, remove whole Alternative
-+	if ! eselect ${provider} update --best > /dev/null; then
-+		eselect alternatives remove ${ALTERNATIVE}
-+	fi
++#	if no provider is present, remove whole alternative
++	eselect ${provider} update --best > /dev/null; ret=$?
++	case ret in
++		0)
++			# All good
++			:;;
++		2)
++			# No provider present anymore
++			eselect alternatives remove ${ALTERNATIVE};;
++		*)
++			write_error_msg "Failed to remove ${ALTERNATIVE}"
++			errors=yes
++	esac
 +}
 +
 +### update action ###
@@ -1018,7 +1087,7 @@ index 0000000..1b5a2b0
 +
 +# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :
 diff --git a/modules/Makefile.am b/modules/Makefile.am
-index 73960c4..4da6465 100644
+index 75ebe02..92127b6 100644
 --- a/modules/Makefile.am
 +++ b/modules/Makefile.am
 @@ -1,6 +1,7 @@
@@ -1026,20 +1095,33 @@ index 73960c4..4da6465 100644
  
  modules_DATA = \
 +	alternatives.eselect \
- 	binutils.eselect \
  	editor.eselect \
  	env.eselect \
+ 	kernel.eselect \
 diff --git a/modules/alternatives.eselect b/modules/alternatives.eselect
 new file mode 100644
-index 0000000..912bb3d
+index 0000000..840b9c5
 --- /dev/null
 +++ b/modules/alternatives.eselect
-@@ -0,0 +1,165 @@
-+# Copyright 2015 Gentoo Foundation
-+# Copyright 2008 Mike Kelly
-+# Copyright 2009, 2013 David Leverton
-+# Copyright 2010 Bo Ørsted Andresen
-+# Distributed under the terms of the GNU General Public License v2
+@@ -0,0 +1,178 @@
++# Copyright (c) 2005-2015 Gentoo Foundation
++# Copyright (c) 2008 Mike Kelly
++# Copyright (c) 2009-2013 David Leverton
++# Copyright (c) 2009-2014 Bo Ørsted Andresen
++#
++# This file is part of the 'eselect' tools framework.
++#
++# eselect is free software: you can redistribute it and/or modify it under the
++# terms of the GNU General Public License as published by the Free Software
++# Foundation, either version 2 of the License, or (at your option) any later
++# version.
++#
++# eselect is distributed in the hope that it will be useful, but WITHOUT ANY
++# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
++# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along with
++# eselect.  If not, see <http://www.gnu.org/licenses/>.
 +
 +inherit alternatives-common
 +
@@ -1201,7 +1283,7 @@ index 0000000..912bb3d
 +	alternatives_options_remove
 +}
 diff --git a/modules/modules.eselect b/modules/modules.eselect
-index 038f630..eb73e16 100644
+index 038f630..78dcbab 100644
 --- a/modules/modules.eselect
 +++ b/modules/modules.eselect
 @@ -2,7 +2,7 @@
@@ -1357,7 +1439,7 @@ index 038f630..eb73e16 100644
  }
  
  ### has action
-@@ -75,56 +112,89 @@ describe_has() {
+@@ -75,56 +112,113 @@ describe_has() {
  }
  
  describe_has_parameters() {
@@ -1425,7 +1507,12 @@ index 038f630..eb73e16 100644
 -# }
 +
 +describe_add() {
-+    echo "Install a module file to \$HOME/.eselect/modules/, or ${ESELECT_DEFAULT_MODULES_PATH//\/\///}/ when run as root"
++    echo "Install a module file"
++}
++
++describe_add_options() {
++    echo "--default : install as global module (default if root)"
++    echo "--user : install as user's module"
 +}
 +
 +describe_add_parameters() {
@@ -1433,28 +1520,33 @@ index 038f630..eb73e16 100644
 +}
 +
 +do_add() {
-+
-+    local local_path="${ROOT}${HOME}/.eselect/modules/" module_file
-+    local force_default=0
-+
-+    if [[ $1 = "--force-default-location" ]] ; then
-+        force_default=1
-+        shift
-+    fi
++    local module_file module_path
++    case $1 in
++	--default)
++	    module_path="${ESELECT_DEFAULT_MODULES_PATH}"
++	    shift
++	    ;;
++	--user)
++	    module_path="${ESELECT_USER_MODULES_PATH}"
++	    mkdir -p "${module_path}" || die -q "Failed to create directory ${module_path}"
++	    shift
++	    ;;
++	*) : ;;
++    esac
 +    module_file=$1
 +
-+    [[ -z ${module_file} ]] && die -q "Required option (module file) missing"
-+
-+    # TODO: Don't install the module "somewhere", depending on write access.
-+    # Add an option to control if it goes to the user's or to the system dir.
-+    if ! cp "${module_file}" "${ESELECT_DEFAULT_MODULES_PATH}" &> /dev/null ; then
-+        [[ ${force_default} == 1 ]] \
-+            && die -q "Failed to install module file to default modules path"
++    [[ -z ${module_file} ]] && die -q "Required module file missing"
 +
-+        mkdir -p "${local_path}" \
-+            || die -q "Failed to create module install directory"
-+        cp "${module_file}" "${local_path}" \
-+                       || die -q "Failed to install module file"
++    if [[ -n ${module_path} ]]; then
++	cp "${module_file}" "${module_path}" &> /dev/null || \
++	    die -q "Failed to install module file to ${module_path}"
++    else
++	if ! cp "${module_file}" "${ESELECT_DEFAULT_MODULES_PATH}" &> /dev/null ; then
++	    mkdir -p "${ESELECT_USER_MODULES_PATH}" \
++		|| die -q "Failed to create directory ${ESELECT_USER_MODULES_PATH}"
++	    cp "${module_file}" "${ESELECT_USER_MODULES_PATH}" \
++		|| die -q "Failed to install module file ${module_file}"
++	fi
 +    fi
 +}
 +
@@ -1462,8 +1554,12 @@ index 038f630..eb73e16 100644
 +
 +describe_remove() {
 +    echo "Remove the given module name"
-+    echo "By default, it will remove from \$HOME/.eselect/modules/, unless running as "
-+    echo "root. Then, remove from ${ESELECT_DATA_PATH}/modules/."
++}
++
++describe_remove_options() {
++    echo "--default : remove global module (default if root)"
++    echo "--alternatives : remove generated alternatives module"
++    echo "--user : remove user module"
 +}
 +
 +describe_remove_parameters() {
@@ -1471,26 +1567,36 @@ index 038f630..eb73e16 100644
 +}
 +
 +do_remove() {
-+    local local_path="${ROOT}${HOME}/.eselect/modules/" module_name
-+    local force_default=0
-+
-+    if [[ $1 = "--force-default-location" ]] ; then
-+        force_default=1
-+        shift
-+    fi
++    local module_name module_path ret
++    case $1 in
++	--alternatives)
++	    module_path="${ESELECT_GENERATED_MODULES_PATH}"
++	    shift
++	    ;;
++	--default)
++	    module_path="${ESELECT_DEFAULT_MODULES_PATH}"
++	    shift
++	    ;;
++	--user)
++	    module_path="${ESELECT_USER_MODULES_PATH}"
++	    shift
++			;;
++	*) : ;;
++    esac
 +    module_name=$1
 +
-+    [[ -z ${module_name} ]] && die -q "Required option (module name) missing"
++    [[ -z ${module_name} ]] && die -q "Required module name missing"
 +
-+    # TODO: Don't install the module "somewhere", depending on write access.
-+    # Add an option to control if it goes to the user's or to the system dir.
-+    if ! rm "${ESELECT_DEFAULT_MODULES_PATH}"/${module_name}.eselect &> /dev/null ; then
-+        [[ ${force_default} == 1 ]] \
-+            && die -q "Failed to remove module ${module_name} from default modules path"
-+
-+        rm "${module_file}" "${local_path}"/${module_name}.eselect \
-+            || die -q "Failed to remove module ${module_name}"
-+       fi
++    if [[ -n ${module_path} ]]; then
++	rm "${module_path}/${module_name}.eselect" &> /dev/null
++	ret=$?
++    else
++	for module_path in "${ESELECT_MODULES_PATH[@]}" ; do
++	    rm "${module_path}/${module_name}.eselect" &> /dev/null
++	    ret=$?
++	done
++    fi
++    [[ ${ret} != 0 ]] && die -q "Failed to remove module ${module_name}"
 +}
 +
 +# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2015-05-24  8:14 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2015-05-24  8:14 UTC (permalink / raw
  To: gentoo-commits

commit:     2074128c90645ffd391f98faa9296c596ae9c9e2
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sun May 24 08:09:37 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sun May 24 08:09:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=2074128c

app-admin/eselect: Latest patch

Package-Manager: portage-2.2.20

 app-admin/eselect/ChangeLog                        |    6 +
 app-admin/eselect/eselect-1.4.4-r101.ebuild        |   72 ++
 .../eselect/files/eselect-1.4.4-alternatives.patch | 1221 ++++++++++++++++++++
 3 files changed, 1299 insertions(+)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index cc795da..47d1515 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+*eselect-1.4.4-r101 (24 May 2015)
+
+  24 May 2015; Justin Lecher <jlec@gentoo.org> +eselect-1.4.4-r101.ebuild,
+  +files/eselect-1.4.4-alternatives.patch:
+  app-admin/eselect: Latest patch
+
   02 Apr 2015; Justin Lecher <jlec@gentoo.org> -eselect-1.3.7-r100.ebuild,
   -eselect-1.3.8-r100.ebuild, -eselect-1.4-r100.ebuild,
   -eselect-1.4.1-r100.ebuild, -eselect-1.4.2-r100.ebuild,

diff --git a/app-admin/eselect/eselect-1.4.4-r101.ebuild b/app-admin/eselect/eselect-1.4.4-r101.ebuild
new file mode 100644
index 0000000..67b835c
--- /dev/null
+++ b/app-admin/eselect/eselect-1.4.4-r101.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit autotools eutils bash-completion-r1
+
+DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
+HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
+SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
+
+LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-3.0 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~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"
+IUSE="doc emacs vim-syntax"
+
+RDEPEND="sys-apps/sed
+	|| (
+		sys-apps/coreutils
+		sys-freebsd/freebsd-bin
+		app-misc/realpath
+	)"
+DEPEND="${RDEPEND}
+	app-arch/xz-utils
+	doc? ( dev-python/docutils )"
+RDEPEND="!app-admin/eselect-news
+	${RDEPEND}
+	sys-apps/file
+	sys-libs/ncurses"
+
+PDEPEND="emacs? ( app-emacs/eselect-mode )
+	vim-syntax? ( app-vim/eselect-syntax )"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-alternatives.patch
+	AT_M4DIR="." eautoreconf
+}
+
+src_compile() {
+	emake
+	use doc && emake html
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+	newbashcomp misc/${PN}.bashcomp ${PN}
+	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
+	use doc && dohtml *.html doc/*
+
+	# needed by news module
+	keepdir /var/lib/gentoo/news
+	if ! use prefix; then
+		fowners root:portage /var/lib/gentoo/news
+		fperms g+w /var/lib/gentoo/news
+	fi
+
+	# band aid for prefix
+	if use prefix; then
+		cd "${ED}"/usr/share/eselect/libs || die
+		sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
+	fi
+}
+
+pkg_postinst() {
+	# fowners in src_install doesn't work for the portage group:
+	# merging changes the group back to root
+	if ! use prefix; then
+		chgrp portage "${EROOT}/var/lib/gentoo/news" \
+			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+	fi
+}

diff --git a/app-admin/eselect/files/eselect-1.4.4-alternatives.patch b/app-admin/eselect/files/eselect-1.4.4-alternatives.patch
new file mode 100644
index 0000000..71c2e67
--- /dev/null
+++ b/app-admin/eselect/files/eselect-1.4.4-alternatives.patch
@@ -0,0 +1,1221 @@
+diff --git a/bin/eselect.in b/bin/eselect.in
+index 934a10a..7c1c14b 100755
+--- a/bin/eselect.in
++++ b/bin/eselect.in
+@@ -22,10 +22,15 @@ ESELECT_DATA_PATH="@DATADIR@/eselect"
+ # Where are modules installed by default?
+ ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
+ 
++# Where are auto-generated modules placed? (e.g. from alternatives-2.eclass)
++ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
++
+ # Look in these places for modules
+-ESELECT_MODULES_PATH=( \
+-	"${HOME}/.eselect/modules" \
+-	"${ESELECT_DEFAULT_MODULES_PATH}" )
++ESELECT_MODULES_PATH=(
++	"${HOME}/.eselect/modules"
++	"${ESELECT_DEFAULT_MODULES_PATH}"
++	"${ESELECT_AUTO_GENERATED_MODULES_PATH}"
++)
+ 
+ # Look in this place for libraries
+ ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
+@@ -64,12 +69,27 @@ fi
+ # Load core functions
+ source "${ESELECT_CORE_PATH}/core.bash" || exit 255
+ # Load necessary functions for the main script
+-inherit manip output path-manipulation tests
++inherit manip output path-manipulation tests config
+ 
+ # Sneaky trick to make die in subshells work. If you don't get
+ # it, don't ask...
+ trap 'echo "exiting" >&2; exit 250' 15
+ 
++# es_find_module foo
++# Find and echo the filename of the foo module. If there's no foo module,
++# die.
++es_find_module() {
++    local modname="$1" modpath="" modfile=""
++	[[ -z ${modname} ]] && die "Usage: ${FUNCNAME} <module>"
++	for modpath in "${ESELECT_MODULES_PATH[@]}" ; do
++		[[ -f ${modpath}/${modname}.eselect ]] && break
++	done
++
++	modfile="${modpath}/${modname}.eselect"
++	[[ -r ${modfile} ]] || die -q "Can't load module ${modname}"
++	echo ${modfile}
++}
++
+ # es_do_usage
+ # Display eselect usage
+ es_do_usage() {
+@@ -81,14 +101,10 @@ es_do_usage() {
+ es_do_help() {
+ 	es_do_usage
+ 	echo
+-	# display all recognized global options
+-	write_list_start "Global options:"
+-	write_kv_list_entry "--brief" "Make output shorter"
+-	write_kv_list_entry "--colour=<yes|no|auto>" \
+-		"Enable or disable colour output (default 'auto')"
++	es_do_list-options
+ 	echo
+ 	# display all available eselect modules
+-	do_action modules list
++	es_do_list-modules
+ }
+ 
+ # es_do_version
+@@ -100,6 +116,114 @@ es_do_version() {
+ 	echo "Distributed under the terms of the GNU GPL version 2 or later."
+ }
+ 
++# es_do_list-options
++# Display all recognized global options
++es_do_list-options() {
++	write_list_start "Global options:"
++	write_kv_list_entry "--brief"                   "Make output shorter"
++	write_kv_list_entry "--colour=<yes|no|auto>"    "Enable or disable colour output (default 'auto')"
++	write_kv_list_entry "--debug"                   "Debug eselect (enable set -x)"
++}
++
++# es_do_list-modules
++# Display all available eselect modules DEPRECATED
++es_do_list-modules() {
++	do_action modules list $@
++}
++
++### print-* actions, for use with bash_completion and zsh-completion ###
++
++# es_do_print-modules
++#
++# Display all availble eselect modules in a way that's useful to bash
++# completion / zsh completion
++es_do_print-modules() {
++	local ret=1 path module group groupname want_descriptions
++
++	while [[ -n $@ ]]; do
++		case "${1}" in
++			--descriptions)
++				want_descriptions='yes' ;;
++			--group)
++				groupname=${2}
++				[[ -z "$groupname" ]] && die -q "Required option (group name) missing."
++				shift ;;
++		esac
++		shift
++	done
++
++	if [[ ${groupname} == Built-in || -z ${groupname} ]]; then
++		for module in help usage version print-{modules,actions,options}; do
++			echo "${module}"
++		done
++		[[ ${groupname} == Built-in ]] && return 0
++	fi
++
++	# TODO: factor this out in modules.eselect's do_list()
++	for path in "${ESELECT_MODULES_PATH[@]}" ; do
++		[[ -d "${path}" ]] || continue
++		for file in "${path}"/*.eselect ; do
++			[[ -f "${file}" ]] || continue
++			if [[ -n "${groupname}" ]]; then
++				group=$(load_config "${file}" ESELECT_MODULE_GROUP)
++				[[ "${groupname}" == "${group}" ||
++					( "${groupname}" == Extra && -z "${group}" ) ]] || continue
++			fi
++			module="${file##*/}"
++			module="${module%%.eselect}"
++			echo "${module}${want_descriptions:+:$(load_config "${file}" DESCRIPTION)}"
++			ret=0
++		done
++	done
++	return $ret
++}
++
++# es_do_print-actions
++#
++# Display all available actions for the given module.
++es_do_print-actions() {
++	local modfile="$(es_find_module "${1}")" actions action want_descriptions
++	[[ "${2}" == "--descriptions" ]] && want_descriptions='yes'
++	(
++		source "${modfile}" 2>/dev/null \
++			|| die "Couldn't source ${modfile}"
++		actions=( $(declare -F \
++			| sed -n -e 's/^declare\s\+-f\s\+do_//p' \
++			| egrep -v '^(action|help|usage|version)$' \
++			| sort ) )
++		for action in "${actions[@]}" ; do
++			echo "${action}${want_descriptions:+:$(describe_${action})}"
++		done
++	)
++}
++
++# es_do_print-options
++#
++# Display all available options for the given module and action
++es_do_print-options() {
++	local modfile action want_descriptions
++
++	[[ "${1}" == "--descriptions" ]] && want_descriptions='yes' && shift
++
++	if [[ -z ${1} ]]; then
++		echo "--debug${want_descriptions:+:Debug eselect (enable set -x)}"
++		echo "--no-color${want_descriptions:+:Disable coloured output}"
++		echo "--no-colour${want_descriptions:+:Disable coloured output}"
++	elif [[ -n ${2} ]]; then
++		modfile="$(es_find_module "${1}")"
++		action=${2}
++		shift 2
++		(
++			source "${modfile}" 2>/dev/null \
++				|| die "Couldn't source ${modfile}"
++			is_function options_${action} || return 1
++			options_${action} ${want_descriptions:+--descriptions} "$@" || return 2
++		)
++	else
++		die "Usage: ${FUNCNAME} [--descriptions] [<module> <action>]"
++	fi
++}
++
+ ### main code ###
+ 
+ # figure out what the action is. we need to know whether we're
+@@ -141,6 +265,9 @@ while [[ ${1##--} != "$1" ]]; do
+ 				*) die -q "Invalid argument for ${1%%=*} option" ;;
+ 			esac
+ 			;;
++		debug)
++			set -x
++			;;
+ 		help|version)
+ 			[[ -z ${action} ]] || die -q "Too many parameters"
+ 			action=${1##--}
+diff --git a/libs/Makefile.am b/libs/Makefile.am
+index 027ef73..a5fe373 100644
+--- a/libs/Makefile.am
++++ b/libs/Makefile.am
+@@ -1,6 +1,8 @@
+ eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
+ 
+ eselectlibs_DATA = \
++	alternatives.bash \
++	alternatives-common.bash \
+ 	config.bash \
+ 	core.bash \
+ 	default.eselect \
+@@ -14,6 +16,8 @@ eselectlibs_DATA = \
+ 	tests.bash
+ 
+ EXTRA_DIST = \
++	alternatives.bash.in \
++	alternatives-common.bash.in \
+ 	config.bash.in \
+ 	core.bash.in \
+ 	default.eselect.in \
+@@ -30,7 +34,8 @@ dosed = @SED@ \
+ 	-e 's%\@SED\@%@SED@%g' \
+ 	-e 's%\@PORTAGEQ\@%@PORTAGEQ@%g' \
+ 	-e 's%\@ENV_UPDATE\@%@ENV_UPDATE@%g' \
+-	-e 's%\@CANONICALISE\@%@CANONICALISE@%g'
++	-e 's%\@CANONICALISE\@%@CANONICALISE@%g' \
++	-e 's%\@sysconfdir\@%@sysconfdir@%g'
+ 
+ %.bash : %.bash.in
+ 	@$(dosed) $< > $@
+diff --git a/libs/alternatives-common.bash.in b/libs/alternatives-common.bash.in
+new file mode 100644
+index 0000000..99de48e
+--- /dev/null
++++ b/libs/alternatives-common.bash.in
+@@ -0,0 +1,372 @@
++# Copyright 2015 Gentoo Foundation
++# Copyright 2008 Mike Kelly
++# Copyright 2009, 2013 David Leverton
++# Copyright 2010 Bo Ørsted Andresen
++# Distributed under the terms of the GNU General Public License v2
++
++inherit config output path-manipulation
++
++ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
++ALTERNATIVESDIR="${EROOT%/}${ALTERNATIVESDIR_ROOTLESS}"
++
++get_current_provider() {
++	local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
++	if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++		local provider=$(readlink "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: readlink ${symlink} failed")
++		[[ ${provider} == */* ]] && die "${dieprefix}: malformed target for ${symlink}"
++
++		if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ||
++					( -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} && ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ) ]]; then
++			die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} is not a directory"
++		fi
++
++		echo "${provider}"
++
++	elif [[ -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++		die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current is not a symlink"
++	fi
++}
++
++compare_importance() {
++	local IFS=.
++	local a=( ${1} ) b=( ${2} )
++	local -i i=0
++	while (( i<${#a[@]} && i<${#b[@]} )); do
++		if (( a[i]<b[i] )); then
++			return 0
++		elif (( a[i]>b[i] )); then
++			return 1
++		fi
++		i+=1
++	done
++	(( i<${#b[@]} ))
++}
++
++sort_providers() {
++	local begin=${1:-0}
++	local count=${2:-${#providers[@]}}
++	[[ ${count} -le 1 ]] && return 0
++	sort_providers ${begin} $((count/2))
++	sort_providers $((begin+count/2)) $((count-count/2))
++	local left=( "${providers[@]:begin:count/2}" )
++	local right=( "${providers[@]:begin+count/2:count-count/2}" )
++	local -i x i=0 j=0
++	for (( x=begin; x<begin+count; ++x )); do
++		if (( j>=${#right[@]} )) || { (( i<${#left[@]} )) && compare_importance "${left[i]%%:*}" "${right[j]%%:*}"; }; then
++			providers[x]=${left[i++]}
++		else
++			providers[x]=${right[j++]}
++		fi
++	done
++}
++
++get_providers() {
++	local p= importance providers=()
++	for p in "${ALTERNATIVESDIR}/${ALTERNATIVE}"/* ; do
++		[[ -d ${p} && ! -L ${p} ]] || continue
++		p=${p##*/}
++
++		importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
++		importance=${importance:-0}
++		[[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
++
++		providers+=( "${importance}:${p}" )
++	done
++
++	sort_providers
++	for (( p=${#providers[@]}-1 ; p>=0 ; --p )); do
++		echo "${providers[p]#*:}"
++	done
++}
++
++_options_parameters() {
++	[[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
++	local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
++	if is_function ${describe_func}; then
++		IFS=$'\n'
++		options=( $(${describe_func}) )
++		IFS=$oldifs
++		for opt in "${options[@]}"; do
++			[[ ${opt} == --* ]] || continue
++			if [[ -n ${descriptions} ]]; then
++				echo "${opt/ : /:}"
++			else
++				echo "${opt%% : *}"
++			fi
++		done
++	fi
++}
++
++### set action stub ###
++
++# not available in "eselect alternatives", but needed by do_update
++
++alternatives_do_set() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++	local force provider providers
++	if [[ ${1} == --force ]]; then
++		force=yes
++		shift
++	fi
++	local idx=${1}
++	if [[ ${1} == +(-|+|[[:digit:]]) ]]; then
++		idx=${1#+(-|+)}
++		providers=( $(get_providers) )
++		(( ${idx} <= ${#providers[@]} )) || die -q "The given provider with index (${idx}) does not exist"
++		provider=${providers[${idx}-1]}
++	else
++		provider="${1}"
++	fi
++	[[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++	local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
++
++	if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++		if is_number ${provider} ; then
++			providers=( $(get_providers) )
++			[[ -n ${providers[${idx}-1]} ]] && \
++				die -q "The given provider (${provider}) does not exist"
++		fi
++		die -q "The given provider (${provider}) does not exist"
++	fi
++
++	local symlink newsymlinks=() oldsymlinks=()
++
++	while read -r -d '' symlink; do
++		local nicesymlink=${symlink#.}
++		nicesymlink=${nicesymlink//+(\/)/\/}
++		[[ ${nicesymlink} == /* ]] || die "${dieprefix}: bad symlink ${symlink}?"
++		[[ ${nicesymlink} == */ ]] && die "${dieprefix}: bad symlink ${symlink}?"
++
++		newsymlinks+=( "${nicesymlink}" )
++	done < <(
++		cd "${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}" || die "${dieprefix}: cd failed"
++		find . -type l -print0 | LC_ALL=C sort -r -u -z)
++	[[ ${#newsymlinks[@]} -gt 0 ]] || die "${dieprefix}: does not provide any symlinks?"
++
++	if [[ -f ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++		while read -r -d '' symlink; do
++			local nicesymlink=${symlink//+(\/)/\/}
++			[[ ${nicesymlink} == /* ]] || die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++			[[ ${nicesymlink} == */ ]] && die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++
++			oldsymlinks+=( "${nicesymlink}" )
++		done < <(LC_ALL=C sort -r -u -z "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list")
++		[[ ${#oldsymlinks[@]} -gt 0 ]] || die "${dieprefix}: old provider ${oldcur} does not provide any symlinks?"
++
++	elif [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list || -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++		die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list is not a file"
++	fi
++
++	local pass errors=
++	for pass in check perform; do
++		local -i new_i=0 old_i=0
++		while [[ -n ${newsymlinks[new_i]} || -n ${oldsymlinks[old_i]} ]]; do
++
++			if ( LC_ALL=C; [[ ${newsymlinks[new_i]} < ${oldsymlinks[old_i]} ]] ); then
++				if [[ ${pass} == check ]]; then
++					if [[ -L ${EROOT%/}${oldsymlinks[old_i]} ]]; then
++						:
++					elif [[ -d ${EROOT%/}${oldsymlinks[old_i]} ]]; then
++						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}"
++						errors=yes
++					elif [[ -e ${EROOT%/}${oldsymlinks[old_i]} ]]; then
++						if [[ -n ${force} ]]; then
++							write_warning_msg "Removing ${EROOT%/}${oldsymlinks[old_i]} due to --force: is not a symlink"
++						else
++							write_error_msg "Refusing to remove ${EROOT%/}${oldsymlinks[old_i]}: is not a symlink (use --force to override)"
++							errors=yes
++						fi
++					fi
++
++				elif [[ ${pass} == perform ]]; then
++					rm -f "${EROOT%/}${oldsymlinks[old_i]}" || die "${dieprefix}: rm failed"
++				else
++					die "${dieprefix}: unknown \${pass} ${pass}???"
++				fi
++
++				old_i+=1
++
++			else
++				local target=${ALTERNATIVESDIR_ROOTLESS#/}/${ALTERNATIVE}/_current${newsymlinks[new_i]} dir=${newsymlinks[new_i]%/*}
++				while [[ -n ${dir} ]]; do
++					target=../${target}
++					dir=${dir%/*}
++				done
++
++				if [[ ${pass} == check ]]; then
++					if [[ -L ${EROOT%/}${newsymlinks[new_i]} ]]; then
++						:
++					elif [[ -d ${EROOT%/}${newsymlinks[new_i]} ]]; then
++						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}"
++						errors=yes
++					elif [[ -e ${EROOT%/}${newsymlinks[new_i]} ]]; then
++						if [[ -n ${force} ]]; then
++							write_warning_msg "Overwriting ${EROOT%/}${newsymlinks[new_i]} due to --force: is not a symlink"
++						else
++							write_error_msg "Refusing to overwrite ${EROOT%/}${newsymlinks[new_i]}: is not a symlink (use --force to override)"
++							errors=yes
++						fi
++					fi
++
++				elif [[ ${pass} == perform ]]; then
++					mkdir -p "${EROOT%/}${newsymlinks[new_i]%/*}" || die "${dieprefix}: mkdir -p failed"
++					ln -snf "${target#/}" "${EROOT%/}${newsymlinks[new_i]}" || die "${dieprefix}: ln -snf failed"
++				else
++					die "${dieprefix}: unknown \${pass} ${pass}???"
++				fi
++
++				[[ ${newsymlinks[new_i]} == ${oldsymlinks[old_i]} ]] && old_i+=1
++				new_i+=1
++			fi
++		done
++
++		[[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++	done
++
++	local oldcur="$(get_current_provider)"
++	ln -snf "${provider}" "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: ln -snf failed"
++
++	: >"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: emptying/creating _current_list failed"
++	for symlink in "${newsymlinks[@]}"; do
++		echo -n -e "${symlink}\\0" >>"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: appending ${symlink} to _current_list failed"
++	done
++	return 0
++}
++
++### update action ###
++
++# available in both "eselect alternatives" and individual modules
++
++alternatives_describe_update() {
++	echo "Set a default provider if no valid one currently exists"
++}
++
++alternatives_describe_update_parameters() {
++	echo "[--best] [--ignore] <provider>"
++}
++
++alternatives_describe_update_options() {
++	echo "--best : update to the best provider even if one is already selected"
++	echo "--ignore : update to any valid provider EXCEPT the specified provider"
++	echo "<provider> : the name of the provider to use"
++}
++
++alternatives_do_update() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++	local p cur=$(get_current_provider) providers=( $(get_providers) ) best ignore
++	if [[ "--best" == ${1} ]] ; then
++		shift
++		best=1
++	fi
++	if [[ "--ignore" == ${1} ]] ; then
++		# Try everything except setting the provider to the given
++		# one. So, if it isn't the given one, we end up doing
++		# nothing. Bug #128
++		shift
++		ignore=${1}
++	fi
++	[[ -n ${best} && -n ${1} && -z ${ignore} ]] && die -q "Cannot specify both --best and a provider"
++
++	if [[ -n ${best} ]] ; then
++		: # fall through to "switch to first available" loop below
++	elif [[ ${cur} == ${1} && -z ${ignore} ]]; then
++		# if current provider was just updated, reselect it since it could have changed
++		alternatives_do_set "${cur}" && return 0
++	elif [[ -n ${cur} && ${cur} != ${ignore} ]] ; then
++		# verify existing provider's symlinks
++		local p= bad=0
++		while read -r -d '' p ; do
++			[[ -L "${EROOT%/}${p}" && -e "${EROOT%/}${p}" ]] || (( bad++ ))
++		done < "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++		[[ "${bad}" -eq 0 ]] && return 0
++		# fix existing provider if possible
++		has "${cur}" "${providers[@]}" && alternatives_do_set "${cur}" && return 0
++	elif has "${1}" "${providers[@]}" && [[ -z ${ignore} ]] ; then
++		# switch to new provider if none was set before or it can't be fixed
++		alternatives_do_set "${1}" && return 0
++	fi
++
++	# if no valid provider has been selected switch to first available, valid
++	# provider, sorted according to importance
++	for p in "${providers[@]}"; do
++		[[ ${ignore} != ${p} ]] && alternatives_do_set "${p}" && return 0
++	done
++
++	# if a provider is set but no providers are available anymore cleanup
++	cur=$(get_current_provider)
++	if [[ -n ${cur} ]]; then
++		alternatives_do_unset "${cur}" && return 2
++	fi
++	# if no provider is set and none are available that are not ignored, return 2 for cleanup
++	[[ -z ${providers[@]} || ${providers[@]} == ${ignore} ]] && return 2
++
++	# we tried everything to select a valid provider, but failed
++	return 1
++}
++
++alternatives_options_update() {
++	_options_parameters ${FUNCNAME#alternatives_} "$@"
++    if [[ -n ${ALTERNATIVE} ]]; then
++	get_providers
++    else
++        for alt in ${ALTERNATIVESDIR_ROOTLESS}/_*/*/_importance; do
++            echo ${alt} | cut -d/ -f5
++        done | sort -u
++    fi
++}
++
++### unset action stub ###
++
++# not available in "eselect alternatives", but needed by do_update
++
++alternatives_do_unset() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++	local force=
++	if [[ ${1} == --force ]]; then
++		force=yes
++		shift
++	fi
++
++	local cur="$(get_current_provider)" p=
++	[[ -n "${cur}" ]] || die -q "Nothing to unset"
++	local dieprefix="Could not unset provider for ${ALTERNATIVE}"
++
++	local one=false symlink pass errors=
++	for pass in check perform; do
++		while read -r -d '' symlink; do
++			one=true
++			if [[ ${pass} == check ]]; then
++				if [[ -L ${EROOT%/}${symlink} ]]; then
++					:
++				elif [[ -d ${EROOT%/}${symlink} ]]; then
++					write_error_msg "Can't remove ${EROOT%/}${symlink}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
++					errors=yes
++				elif [[ -e ${EROOT%/}${symlink} ]]; then
++					if [[ -n ${force} ]]; then
++						write_warning_msg "Removing ${EROOT%/}${symlink} due to --force: is not a symlink"
++					else
++						write_error_msg "Refusing to remove ${EROOT%/}${symlink}: is not a symlink (use --force to override)"
++						errors=yes
++					fi
++				fi
++
++			elif [[ ${pass} == perform ]]; then
++				rm -f "${EROOT%/}${symlink}" || die "${dieprefix}: rm failed"
++			else
++				die "${dieprefix}: unknown \${pass} ${pass}???"
++			fi
++		done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++		[[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++	done
++
++	${one} || die "${dieprefix}: does not provide any symlinks?"
++
++	rm "${ALTERNATIVESDIR}/${ALTERNATIVE}"/{_current,_current_list} || die "${dieprefix}: rm failed"
++}
++
++# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :
+diff --git a/libs/alternatives.bash.in b/libs/alternatives.bash.in
+new file mode 100644
+index 0000000..c2512e1
+--- /dev/null
++++ b/libs/alternatives.bash.in
+@@ -0,0 +1,249 @@
++# Copyright 2015 Gentoo Foundation
++# Copyright 2008 Mike Kelly
++# Copyright 2009, 2013 David Leverton
++# Copyright 2010 Bo Ørsted Andresen
++# Distributed under the terms of the GNU General Public License v2
++
++inherit alternatives-common
++
++### show action ###
++describe_show() {
++	echo "Show the current provider in use for ${ALTERNATIVE}"
++}
++
++do_show() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++	local current="$(get_current_provider)"
++	if [[ -z "${current}" ]] ; then
++		echo "(none)"
++		return 2
++	fi
++	echo "${current}"
++}
++
++options_show() {
++	:
++}
++
++### list action ###
++describe_list() {
++	echo "Lists all available providers for ${ALTERNATIVE}"
++}
++
++do_list() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++	local n cur= providers=( $(get_providers) )
++	write_list_start "Available providers for ${ALTERNATIVE}:"
++
++	cur="$(get_current_provider)"
++
++	if [[ -n "${providers[@]}" ]] ; then
++		for (( n = 0 ; n < ${#providers[@]} ; ++n )) ; do
++			[[ ${cur} ==  "${providers[${n}]}" ]] && \
++				providers[${n}]="${providers[${n}]} $(highlight '*')"
++		done
++		write_numbered_list "${providers[@]}"
++	else
++		write_kv_list_entry "(none found)" ""
++	fi
++}
++
++options_list() {
++	:
++}
++
++### files action ###
++describe_files() {
++	echo "Lists symlinks provided by the currently selected provider"
++}
++
++do_files() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++	local cur="$(get_current_provider)" p=
++	[[ -n "${cur}" ]] || die -q "No selected provider, hence no symlinks provided"
++	local dieprefix="Could not list symlinks provided for ${ALTERNATIVE}"
++
++	local errors symlink rootsymlink
++	while read -r -d '' symlink; do
++		rootsymlink="${EROOT%/}${symlink}"
++		rootsymlink=${rootsymlink//+(\/)/\/}
++		echo "${rootsymlink}"
++		if [[ -L ${rootsymlink} ]]; then
++			if [[ ! -e ${rootsymlink} ]]; then
++				write_error_msg "${rootsymlink} is dangling symlink"
++				errors=yes
++			fi
++		elif [[ -d ${rootsymlink} ]]; then
++			write_error_msg "${rootsymlink} is a directory"
++			errors=yes
++		elif [[ -e ${rootsymlink} ]]; then
++			write_error_msg "${rootsymlink} exists but is not a symlink"
++			errors=yes
++		else
++			write_error_msg "${rootsymlink} does not exist"
++			errors=yes
++		fi
++	done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++}
++
++options_files() {
++	:
++}
++
++### set action ###
++
++describe_set() {
++	echo "Sets a provider for ${ALTERNATIVE}"
++}
++
++describe_set_parameters() {
++	echo "[ --force ] <provider>"
++}
++
++describe_set_options() {
++	echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
++	echo "<provider> : the name of the provider to use or the index of the provider preceeded by a dash"
++}
++
++do_set() {
++	# implementation defined in alternatives-common.bash as needed by do_update
++	alternatives_do_set "$@"
++}
++
++options_set() {
++	_options_parameters $FUNCNAME "$@"
++	get_providers
++}
++
++### update action ###
++
++# all functions implemented in alternatives-common.bash as defined for
++# both "eselect alternatives" and individual modules
++
++describe_update() {
++	alternatives_describe_update
++}
++
++describe_update_parameters() {
++	alternatives_describe_update_parameters
++}
++
++describe_update_options() {
++	alternatives_describe_update_options
++}
++
++do_update() {
++	alternatives_do_update "$@"
++}
++
++options_update() {
++	alternatives_options_update
++}
++
++### unset action ###
++
++describe_unset() {
++	echo "Unset any symlinks created for the current provider for ${ALTERNATIVE}."
++}
++
++describe_unset_parameters() {
++	echo "[ --force ]"
++}
++
++describe_unset_options() {
++	echo "--force : remove existing non-symlink files (but not directories) if necessary"
++}
++
++do_unset() {
++	# implementation defined in alternatives-common.bash as needed by do_update
++	alternatives_do_unset "$@"
++}
++
++options_unset() {
++	_options_parameters $FUNCNAME "$@"
++	get_current_provider
++}
++
++### script action ###
++
++describe_script() {
++	echo "Output an evalable script fragment to set PATH, LD_LIBRARY_PATH and MANPATH to use the specified provider"
++}
++
++describe_script_parameters() {
++	echo "[--sh | --csh] [<provider>]"
++}
++
++describe_script_options() {
++	echo "--sh : use Bourne shell syntax (default)"
++	echo "--csh : use C shell syntax"
++	echo "<provider> : the provider to use or the index of the provider (if not specified, use the system default)"
++}
++
++do_script() {
++	[[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++	local syntax=sh provider providers
++	if [[ ${1} == --sh ]]; then
++		shift
++	elif [[ ${1} == --csh ]]; then
++		syntax=csh
++		shift
++	fi
++
++	local idx=${!}
++	if [[ ${idx} == +(-|+|[[:digit:]]) ]]; then
++	idx=${1#+(-|+)}
++		providers=( $(get_providers) )
++		(( ${idx} <= ${#providers[@]} )) || die -q "The given provider with index (${idx}) does not exist"
++		provider=${providers[${idx}-1]}
++	else
++		provider="${idx}"
++	fi
++	[[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++
++	if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++		if is_number ${provider} ; then
++			providers=( $(get_providers) )
++			[[ -n ${providers[${idx}-1]} ]] && \
++				die -q "The given provider (${provider}) does not exist"
++		fi
++		die -q "The given provider (${provider}) does not exist"
++	fi
++
++	local variables=( PATH LD_LIBRARY_PATH MANPATH )
++	[[ -n ${!default_*} ]] && local ${!default_*}
++	local default_LD_LIBRARY_PATH=$(grep '^[^#]' "${EROOT%/}"/etc/ld.so.conf | tr '\n' ':')/lib:/usr/lib
++	local default_MANPATH=$(MANPATH= man -C"${EROOT%/}"/etc/man.conf -w)
++
++	local var IFS=:
++	for var in "${variables[@]}"; do
++		local defvar=default_${var} path paths=( )
++		for path in ${!var}; do
++			[[ ${path} == ${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/* ]] && continue
++			[[ -n ${provider} && -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++			paths+=( "${path}" )
++		done
++
++		[[ -n ${provider} ]] && for path in ${!defvar}; do
++			[[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++		done
++
++		local newval=${paths[*]}
++		if [[ ${newval} != ${!var} ]]; then
++			newval=${newval//\'/\'\\\'\'}
++			if [[ ${syntax} == sh ]]; then
++				echo "${var}='${newval}'; export ${var}"
++			else
++				echo "setenv ${var} '${newval}'"
++			fi
++		fi
++	done
++}
++
++options_script() {
++	_options_parameters $FUNCNAME "$@"
++	get_providers
++}
++
++# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :
+diff --git a/modules/Makefile.am b/modules/Makefile.am
+index 73960c4..4da6465 100644
+--- a/modules/Makefile.am
++++ b/modules/Makefile.am
+@@ -1,6 +1,7 @@
+ modulesdir=$(datadir)/$(PACKAGE_NAME)/modules/
+ 
+ modules_DATA = \
++	alternatives.eselect \
+ 	binutils.eselect \
+ 	editor.eselect \
+ 	env.eselect \
+diff --git a/modules/alternatives.eselect b/modules/alternatives.eselect
+new file mode 100644
+index 0000000..b1c219f
+--- /dev/null
++++ b/modules/alternatives.eselect
+@@ -0,0 +1,50 @@
++# Copyright 2015 Gentoo Foundation
++# Copyright 2008 Mike Kelly
++# Copyright 2009, 2013 David Leverton
++# Copyright 2010 Bo Ørsted Andresen
++# Distributed under the terms of the GNU General Public License v2
++
++inherit alternatives-common
++
++DESCRIPTION="Maintain Alternatives symlinks"
++VERSION="20150521"
++MAINTAINER="sci@gentoo.org"
++
++show_extra_help_text() {
++	cat <<- ENDOFTEXT
++	This module is intended for internal use when a package is installed,
++	updated or removed. For alternatives for which it is likely that
++	users will need control over which provider is selected, there will be
++	a separate eselect module installed to do so.
++	ENDOFTEXT
++}
++
++### update action ###
++
++# all functions implemented in alternatives-common.bash as defined for
++# both "eselect alternatives" and individual modules
++
++describe_update() {
++	alternatives_describe_update
++}
++
++describe_update_parameters() {
++	echo "<alternative> $(alternatives_describe_update_parameters)"
++}
++
++describe_update_options() {
++	echo "<alternative> : the name of the alternative to set a provider for"
++	alternatives_describe_update_options
++}
++
++do_update() {
++	local ALTERNATIVE=$1
++	shift
++	[[ -z "${ALTERNATIVE}" ]] && die -q "Missing required parameter 'alternative'"
++	alternatives_do_update "$@"
++}
++
++options_update() {
++	alternatives_options_update
++}
++
+diff --git a/modules/modules.eselect b/modules/modules.eselect
+index 038f630..eb73e16 100644
+--- a/modules/modules.eselect
++++ b/modules/modules.eselect
+@@ -2,7 +2,7 @@
+ # Copyright 2006-2015 Gentoo Foundation
+ # Distributed under the terms of the GNU GPL version 2 or later
+ 
+-inherit config
++inherit config output tests
+ 
+ DESCRIPTION="Query eselect modules"
+ MAINTAINER="eselect@gentoo.org"
+@@ -15,57 +15,94 @@ describe_list() {
+ 	echo "List all available modules"
+ }
+ 
+-describe_list_options() {
+-	echo "--only-names : Output names of modules only"
+-}
+-
+ # List all installed modules
+ do_list() {
+-	local only_names path file module name desc
+-	local -a extra_modules
+-
+-	if [[ ${1#--} = only-names ]]; then
+-		only_names=1
+-		shift
+-	fi
+-	[[ $# -gt 0 ]] && die -q "Too many parameters"
+-
+-	for path in "${ESELECT_MODULES_PATH[@]}" ; do
+-		[[ -d ${path} ]] || continue
+-		for file in "${path}"/*.eselect ; do
+-			[[ -f ${file} ]] || continue
+-			extra_modules=( "${extra_modules[@]}" "${file}" )
+-		done
+-	done
+-
+-	if [[ -n ${only_names} ]]; then
+-		# This is mainly intended for bash completion
+-		echo "help"
+-		echo "usage"
+-		echo "version"
+-		for module in "${extra_modules[@]}" ; do
+-			name=${module##*/}
+-			echo "${name%%.eselect}"
+-		done
+-	else
+-		write_list_start "Built-in modules:"
+-		write_kv_list_entry "help"			"Display a help message"
+-		write_kv_list_entry "usage"			"Display a usage message"
+-		write_kv_list_entry "version"		"Display version information"
+-
+-		if [[ ${#extra_modules[@]} -gt 0 ]] ; then
+-			echo
+-			write_list_start "Extra modules:"
+-			for module in "${extra_modules[@]}" ; do
+-				name=${module##*/}
+-				name=${name%%.eselect}
+-				desc=$(ESELECT_MODULE_NAME=${name} \
+-					load_config "${module}" DESCRIPTION)
+-				desc=${desc:-No description available}
+-				write_kv_list_entry "${name}" "${desc}"
+-			done
+-		fi
+-	fi
++    local path file module name desc group groups Extra_modules
++
++    write_list_start "Built-in modules:"
++    write_kv_list_entry "help"          "Display a help message"
++    write_kv_list_entry "usage"         "Display a usage message"
++    write_kv_list_entry "version"       "Display version information"
++    write_kv_list_entry "print-modules" "Print eselect modules"
++    write_kv_list_entry "print-actions" "Print actions for a given module"
++    write_kv_list_entry "print-options" "Print options for a given action"
++
++    for path in "${ESELECT_MODULES_PATH[@]}" ; do
++        [[ -d ${path} ]] || continue
++        for file in ${path}/*.eselect ; do
++            [[ -f ${file} ]] || continue
++            group=$(load_config "${file}" ESELECT_MODULE_GROUP)
++            if [[ -n ${group} ]]; then
++                has ${group} ${groups} || groups+=" ${group}"
++                declare ${group}_modules+=" ${file}"
++            else
++                Extra_modules+=" ${file}"
++            fi
++        done
++    done
++
++    for group in ${groups} Extra; do
++        local m
++        m="${group}_modules"
++        if [[ -n ${!m} ]] ; then
++            echo
++            write_list_start "${group} modules:"
++            for module in ${!m}; do
++                name=${module##*/}
++                name=${name%%.eselect}
++                desc=$(load_config "${module}" DESCRIPTION)
++                desc=${desc:-No description available}
++                write_kv_list_entry "${name}" "${desc}"
++            done
++        fi
++    done
++}
++
++### group action
++
++describe_group() {
++    echo "Lists all available modules belonging to a specified group."
++}
++
++describe_group_parameters() {
++    echo "<group>"
++}
++
++do_group() {
++    local path file groupname="$1" group module modules name desc
++    [[ -z "$groupname" ]] && die -q "Required option (group name) missing."
++
++    if [[ ${groupname} == Built-in ]]; then
++        write_list_start "Built-in modules:"
++        write_kv_list_entry "help"          "Display a help message"
++        write_kv_list_entry "usage"         "Display a usage message"
++        write_kv_list_entry "version"       "Display version information"
++        return 0
++    fi
++
++    for path in "${ESELECT_MODULES_PATH[@]}" ; do
++        [[ -d ${path} ]] || continue
++        for file in ${path}/*.eselect ; do
++            [[ -f ${file} ]] || continue
++            group=$(load_config "${file}" ESELECT_MODULE_GROUP)
++            [[ ${groupname} == ${group} ||
++                ( ${groupname} == Extra && -z ${group} ) ]] || continue
++            modules+=" ${file}"
++        done
++    done
++
++    if [[ -n ${modules} ]] ; then
++        write_list_start "${groupname} modules:"
++        for module in ${modules}; do
++            name=${module##*/}
++            name=${name%%.eselect}
++            desc=$(load_config "${module}" DESCRIPTION)
++            desc=${desc:-No description available}
++            write_kv_list_entry "${name}" "${desc}"
++        done
++    else
++        die -q "No modules belonging to ${groupname} was found"
++    fi
+ }
+ 
+ ### has action
+@@ -75,56 +112,89 @@ describe_has() {
+ }
+ 
+ describe_has_parameters() {
+-	echo "<module>"
++    echo "<module>"
+ }
+ 
+ do_has() {
+-	[[ -z $1 ]] && die -q "Required option (module name) missing"
+-	[[ $# -gt 1 ]] && die -q "Too many parameters"
+-
+-	local modname=$1 modpath
+-	for modpath in "${ESELECT_MODULES_PATH[@]}" ; do
+-		[[ -f ${modpath}/${modname}.eselect ]] && return 0
+-	done
+-	return 1
++    [[ -z $1 ]] && die -q "Required option (module name) missing"
++    [[ $# -gt 1 ]] && die -q "Too many parameters"
++    local modname="$1" modpath
++    [[ -z "$modname" ]] && die -q "Required option (module name) missing."
++    for modpath in "${ESELECT_MODULES_PATH[@]}" ; do
++        [[ -f "${modpath}/${modname}.eselect" ]] && return 0
++    done
++    return 1
+ }
+ 
+ ### add action
+-# *** Commented out. Do we really want to have an eselect module that is
+-# *** installing other modules in a system directory? Also, this should
+-# *** go together with a "remove" action.
+-
+-# describe_add() {
+-# 	echo "Install the given module file somewhere that eselect can find it."
+-# 	echo "By default, install to \$HOME/.eselect/modules/, unless running as "
+-# 	echo "root. Then, install to ${ESELECT_DATA_PATH}/modules/."
+-# }
+-
+-# describe_add_parameters() {
+-# 	echo "<module_file>"
+-# }
+-
+-# do_add() {
+-# 	local local_path="${ROOT}${HOME}/.eselect/modules/" module_file
+-# 	local force_default=0
+-#
+-# 	if [[ $1 = "--force-default-location" ]] ; then
+-# 		force_default=1
+-# 		shift
+-# 	fi
+-# 	module_file=$1
+-#
+-# 	[[ -z ${module_file} ]] && die -q "Required option (module file) missing"
+-#
+-# 	# TODO: Don't install the module "somewhere", depending on write access.
+-# 	# Add an option to control if it goes to the user's or to the system dir.
+-# 	if ! cp "${module_file}" "${ESELECT_DEFAULT_MODULES_PATH}" &> /dev/null ; then
+-# 		[[ ${force_default} == 1 ]] \
+-# 			&& die -q "Failed to install module file to default modules path"
+-#
+-# 		mkdir -p "${local_path}" \
+-# 			|| die -q "Failed to create module install directory"
+-# 		cp "${module_file}" "${local_path}" \
+-# 			|| die -q "Failed to install module file"
+-# 	fi
+-# }
++
++describe_add() {
++    echo "Install a module file to \$HOME/.eselect/modules/, or ${ESELECT_DEFAULT_MODULES_PATH//\/\///}/ when run as root"
++}
++
++describe_add_parameters() {
++    echo "<module_file>"
++}
++
++do_add() {
++
++    local local_path="${ROOT}${HOME}/.eselect/modules/" module_file
++    local force_default=0
++
++    if [[ $1 = "--force-default-location" ]] ; then
++        force_default=1
++        shift
++    fi
++    module_file=$1
++
++    [[ -z ${module_file} ]] && die -q "Required option (module file) missing"
++
++    # TODO: Don't install the module "somewhere", depending on write access.
++    # Add an option to control if it goes to the user's or to the system dir.
++    if ! cp "${module_file}" "${ESELECT_DEFAULT_MODULES_PATH}" &> /dev/null ; then
++        [[ ${force_default} == 1 ]] \
++            && die -q "Failed to install module file to default modules path"
++
++        mkdir -p "${local_path}" \
++            || die -q "Failed to create module install directory"
++        cp "${module_file}" "${local_path}" \
++                       || die -q "Failed to install module file"
++    fi
++}
++
++### remove action
++
++describe_remove() {
++    echo "Remove the given module name"
++    echo "By default, it will remove from \$HOME/.eselect/modules/, unless running as "
++    echo "root. Then, remove from ${ESELECT_DATA_PATH}/modules/."
++}
++
++describe_remove_parameters() {
++    echo "<module>"
++}
++
++do_remove() {
++    local local_path="${ROOT}${HOME}/.eselect/modules/" module_name
++    local force_default=0
++
++    if [[ $1 = "--force-default-location" ]] ; then
++        force_default=1
++        shift
++    fi
++    module_name=$1
++
++    [[ -z ${module_name} ]] && die -q "Required option (module name) missing"
++
++    # TODO: Don't install the module "somewhere", depending on write access.
++    # Add an option to control if it goes to the user's or to the system dir.
++    if ! rm "${ESELECT_DEFAULT_MODULES_PATH}"/${module_name}.eselect &> /dev/null ; then
++        [[ ${force_default} == 1 ]] \
++            && die -q "Failed to remove module ${module_name} from default modules path"
++
++        rm "${module_file}" "${local_path}"/${module_name}.eselect \
++            || die -q "Failed to remove module ${module_name}"
++       fi
++}
++
++# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2014-05-26  7:07 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2014-05-26  7:07 UTC (permalink / raw
  To: gentoo-commits

commit:     d4cc98b5c88c00fe6a87ce1556657c6f8875bdb0
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Mon May 26 07:06:54 2014 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon May 26 07:06:54 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=d4cc98b5

app-admin/eselect: Version Bump

Package-Manager: portage-2.2.10

---
 app-admin/eselect/ChangeLog                        |   6 +
 app-admin/eselect/eselect-1.4.2-r100.ebuild        |  72 +++
 .../eselect/files/eselect-1.4.2-alternatives.patch | 616 +++++++++++++++++++++
 3 files changed, 694 insertions(+)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index 17bab6b..ab8f2ad 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+*eselect-1.4.2-r100 (26 May 2014)
+
+  26 May 2014; Justin Lecher <jlec@gentoo.org> +eselect-1.4.2-r100.ebuild,
+  +files/eselect-1.4.2-alternatives.patch:
+  Version Bump
+
 *eselect-1.4.1-r100 (15 Feb 2014)
 
   15 Feb 2014; Justin Lecher <jlec@gentoo.org> +eselect-1.4.1-r100.ebuild,

diff --git a/app-admin/eselect/eselect-1.4.2-r100.ebuild b/app-admin/eselect/eselect-1.4.2-r100.ebuild
new file mode 100644
index 0000000..3c136ae
--- /dev/null
+++ b/app-admin/eselect/eselect-1.4.2-r100.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit autotools eutils bash-completion-r1
+
+DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
+HOMEPAGE="http://wiki.gentoo.org/wiki/Project:Eselect"
+SRC_URI="http://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
+
+LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
+SLOT="0"
+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"
+IUSE="doc emacs vim-syntax"
+
+RDEPEND="sys-apps/sed
+	|| (
+		sys-apps/coreutils
+		sys-freebsd/freebsd-bin
+		app-misc/realpath
+	)"
+DEPEND="${RDEPEND}
+	app-arch/xz-utils
+	doc? ( dev-python/docutils )"
+RDEPEND="!app-admin/eselect-news
+	${RDEPEND}
+	sys-apps/file
+	sys-libs/ncurses"
+
+PDEPEND="emacs? ( app-emacs/eselect-mode )
+	vim-syntax? ( app-vim/eselect-syntax )"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-1.4.2-alternatives.patch
+	AT_M4DIR="." eautoreconf
+}
+
+src_compile() {
+	emake
+	use doc && emake html
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+	newbashcomp misc/${PN}.bashcomp ${PN}
+	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
+	use doc && dohtml *.html doc/*
+
+	# needed by news module
+	keepdir /var/lib/gentoo/news
+	if ! use prefix; then
+		fowners root:portage /var/lib/gentoo/news
+		fperms g+w /var/lib/gentoo/news
+	fi
+
+	# band aid for prefix
+	if use prefix; then
+		cd "${ED}"/usr/share/eselect/libs
+		sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
+	fi
+}
+
+pkg_postinst() {
+	# fowners in src_install doesn't work for the portage group:
+	# merging changes the group back to root
+	if ! use prefix; then
+		chgrp portage "${EROOT}/var/lib/gentoo/news" \
+			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+	fi
+}

diff --git a/app-admin/eselect/files/eselect-1.4.2-alternatives.patch b/app-admin/eselect/files/eselect-1.4.2-alternatives.patch
new file mode 100644
index 0000000..3f4a34b
--- /dev/null
+++ b/app-admin/eselect/files/eselect-1.4.2-alternatives.patch
@@ -0,0 +1,616 @@
+Index: bin/eselect.in
+===================================================================
+--- bin/eselect.in	(revision 863)
++++ bin/eselect.in	(working copy)
+@@ -22,10 +22,15 @@
+ # Where are modules installed by default?
+ ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
+ 
++# Where are auto-generated modules placed? (e.g. from alternatives-2.eclass)
++ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
++
+ # Look in these places for modules
+-ESELECT_MODULES_PATH=( \
+-	"${HOME}/.eselect/modules" \
+-	"${ESELECT_DEFAULT_MODULES_PATH}" )
++ESELECT_MODULES_PATH=(
++	"${HOME}/.eselect/modules"
++	"${ESELECT_DEFAULT_MODULES_PATH}"
++	"${ESELECT_AUTO_GENERATED_MODULES_PATH}"
++)
+ 
+ # Look in this place for libraries
+ ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
+--- bin/Makefile.am.orig	2013-09-02 14:35:05.328684465 +0400
++++ bin/Makefile.am	2013-09-02 14:49:50.895842067 +0400
+@@ -4,6 +4,7 @@
+ dosed = @SED@ -e 's%\@BASH\@%$(BASH)%g' \
+ 	      -e 's%\@DATADIR\@%$(datadir)%g' \
+ 	      -e 's%\@EPREFIX\@%$(EPREFIX)%g' \
++	      -e 's%\@LIBEXECDIR\@%$(datadir)%g' \
+ 	      -e 's%\@VERSION\@%$(VERSION)$(EXTRAVERSION)%g'
+ 
+ % : %.in
+Index: libs/Makefile.am
+===================================================================
+--- libs/Makefile.am	(revision 863)
++++ libs/Makefile.am	(working copy)
+@@ -1,6 +1,7 @@
+ eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
+ 
+ eselectlibs_DATA = \
++	alternatives.bash \
+ 	config.bash \
+ 	core.bash \
+ 	default.eselect \
+@@ -14,6 +15,7 @@
+ 	tests.bash
+ 
+ EXTRA_DIST = \
++	alternatives.bash.in \
+ 	config.bash.in \
+ 	core.bash.in \
+ 	default.eselect.in \
+@@ -30,7 +32,8 @@
+ 	-e 's%\@SED\@%@SED@%g' \
+ 	-e 's%\@PORTAGEQ\@%@PORTAGEQ@%g' \
+ 	-e 's%\@ENV_UPDATE\@%@ENV_UPDATE@%g' \
+-	-e 's%\@CANONICALISE\@%@CANONICALISE@%g'
++	-e 's%\@CANONICALISE\@%@CANONICALISE@%g' \
++	-e 's%\@sysconfdir\@%@sysconfdir@%g'
+ 
+ %.bash : %.bash.in
+ 	@$(dosed) $< > $@
+--- libs/alternatives.bash.in.orig	1970-01-01 01:00:00.000000000 +0100
++++ libs/alternatives.bash.in	2011-09-06 18:55:43.000000000 +0100
+@@ -0,0 +1,550 @@
++# Copyright 2008 Mike Kelly
++# Copyright 2009 David Leverton
++# Copyright 2010 Bo Ørsted Andresen
++# 2010: Adapted to eselect Sebastien Fabbro (who doesn't like copyrights)
++# Distributed under the terms of the GNU General Public License v2
++
++inherit config output path-manipulation
++
++ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
++ALTERNATIVESDIR="${EROOT}${ALTERNATIVESDIR_ROOTLESS}"
++
++get_current_provider() {
++    local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
++    if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++        local provider=$(readlink "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: readlink ${symlink} failed")
++        [[ ${provider} == */* ]] && die "${dieprefix}: malformed target for ${symlink}"
++
++        if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ||
++                    ( -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} && ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ) ]]; then
++            die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} is not a directory"
++        fi
++
++        echo "${provider}"
++
++    elif [[ -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++        die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current is not a symlink"
++    fi
++}
++
++compare_importance() {
++    local IFS=.
++    local a=( ${1} ) b=( ${2} )
++    local -i i=0
++    while (( i<${#a[@]} && i<${#b[@]} )); do
++        if (( a[i]<b[i] )); then
++            return 0
++        elif (( a[i]>b[i] )); then
++            return 1
++        fi
++        i+=1
++    done
++    (( i<${#b[@]} ))
++}
++
++sort_providers() {
++    local begin=${1:-0}
++    local count=${2:-${#providers[@]}}
++    [[ ${count} -le 1 ]] && return 0
++    sort_providers ${begin} $((count/2))
++    sort_providers $((begin+count/2)) $((count-count/2))
++    local left=( "${providers[@]:begin:count/2}" )
++    local right=( "${providers[@]:begin+count/2:count-count/2}" )
++    local -i x i=0 j=0
++    for (( x=begin; x<begin+count; ++x )); do
++        if (( j>=${#right[@]} )) || { (( i<${#left[@]} )) && compare_importance "${left[i]%%:*}" "${right[j]%%:*}"; }; then
++            providers[x]=${left[i++]}
++        else
++            providers[x]=${right[j++]}
++        fi
++    done
++}
++
++get_providers() {
++    local p= importance providers=()
++    for p in "${ALTERNATIVESDIR}/${ALTERNATIVE}"/* ; do
++        [[ -d ${p} && ! -L ${p} ]] || continue
++        p=${p##*/}
++
++        importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
++        importance=${importance:-0}
++        [[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
++
++        providers+=( "${importance}:${p}" )
++    done
++
++    sort_providers
++    for (( p=${#providers[@]}-1 ; p>=0 ; --p )); do
++        echo "${providers[p]#*:}"
++    done
++}
++
++### show action ###
++describe_show() {
++    echo "Show the current provider in use for ${ALTERNATIVE}"
++}
++
++do_show() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local current="$(get_current_provider)"
++    if [[ -z "${current}" ]] ; then
++        echo "(none)"
++        return 2
++    fi
++    echo "${current}"
++}
++
++options_show() {
++    :
++}
++
++### list action ###
++describe_list() {
++    echo "Lists all available providers for ${ALTERNATIVE}"
++}
++
++do_list() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local n cur= providers=( $(get_providers) )
++    write_list_start "Available providers for ${ALTERNATIVE}:"
++
++    cur="$(get_current_provider)"
++
++    if [[ -n "${providers[@]}" ]] ; then
++        for (( n = 0 ; n < ${#providers[@]} ; ++n )) ; do
++            [[ ${cur} ==  "${providers[${n}]}" ]] && \
++                providers[${n}]="${providers[${n}]} $(highlight '*')"
++        done
++        write_numbered_list "${providers[@]}"
++    else
++        write_kv_list_entry "(none found)" ""
++    fi
++}
++
++options_list() {
++    :
++}
++
++### files action ###
++describe_files() {
++    echo "Lists symlinks provided by the currently selected provider"
++}
++
++do_files() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local cur="$(get_current_provider)" p=
++    [[ -n "${cur}" ]] || die -q "No selected provider, hence no symlinks provided"
++    local dieprefix="Could not list symlinks provided for ${ALTERNATIVE}"
++
++    local errors symlink rootsymlink
++    while read -r -d '' symlink; do
++        rootsymlink="${EROOT}${symlink}"
++        rootsymlink=${rootsymlink//+(\/)/\/}
++        echo "${rootsymlink}"
++        if [[ -L ${rootsymlink} ]]; then
++            if [[ ! -e ${rootsymlink} ]]; then
++                write_error_msg "${rootsymlink} is dangling symlink"
++                errors=yes
++            fi
++        elif [[ -d ${rootsymlink} ]]; then
++            write_error_msg "${rootsymlink} is a directory"
++            errors=yes
++        elif [[ -e ${rootsymlink} ]]; then
++            write_error_msg "${rootsymlink} exists but is not a symlink"
++            errors=yes
++        else
++            write_error_msg "${rootsymlink} does not exist"
++            errors=yes
++        fi
++    done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++}
++
++options_files() {
++    :
++}
++
++### set action ###
++
++describe_set() {
++    echo "Sets a provider for ${ALTERNATIVE}"
++}
++
++describe_set_parameters() {
++    echo "[ --force ] <provider>"
++}
++
++describe_set_options() {
++    echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
++    echo "<provider> : the name of the provider to use or the index of the provider preceeded by a dash"
++}
++
++do_set() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local force provider providers
++    if [[ ${1} == --force ]]; then
++        force=yes
++        shift
++    fi
++
++    if [[ ${1} == -+([[:digit:]]) ]]; then
++        providers=( $(get_providers) )
++        (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
++        provider=${providers[${1#-}-1]}
++    else
++        provider="${1}"
++    fi
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++    local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
++
++    if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++        if is_number ${provider} ; then
++            providers=( $(get_providers) )
++            [[ -n ${providers[${1#-}-1]} ]] &&
++                die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
++        fi
++        die -q "The given provider (${provider}) does not exist"
++    fi
++
++    local symlink newsymlinks=() oldsymlinks=()
++
++    while read -r -d '' symlink; do
++        local nicesymlink=${symlink#.}
++        nicesymlink=${nicesymlink//+(\/)/\/}
++        [[ ${nicesymlink} == /* ]] || die "${dieprefix}: bad symlink ${symlink}?"
++        [[ ${nicesymlink} == */ ]] && die "${dieprefix}: bad symlink ${symlink}?"
++
++        newsymlinks+=( "${nicesymlink}" )
++    done < <(
++        cd "${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}" || die "${dieprefix}: cd failed"
++        find . -type l -print0 | LC_ALL=C sort -r -u -z)
++    [[ ${#newsymlinks[@]} -gt 0 ]] || die "${dieprefix}: does not provide any symlinks?"
++
++    if [[ -f ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++        while read -r -d '' symlink; do
++            local nicesymlink=${symlink//+(\/)/\/}
++            [[ ${nicesymlink} == /* ]] || die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++            [[ ${nicesymlink} == */ ]] && die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++
++            oldsymlinks+=( "${nicesymlink}" )
++        done < <(LC_ALL=C sort -r -u -z "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list")
++        [[ ${#oldsymlinks[@]} -gt 0 ]] || die "${dieprefix}: old provider ${oldcur} does not provide any symlinks?"
++
++    elif [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list || -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++        die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list is not a file"
++    fi
++
++    local pass errors=
++    for pass in check perform; do
++        local -i new_i=0 old_i=0
++        while [[ -n ${newsymlinks[new_i]} || -n ${oldsymlinks[old_i]} ]]; do
++
++            if ( LC_ALL=C; [[ ${newsymlinks[new_i]} < ${oldsymlinks[old_i]} ]] ); then
++                if [[ ${pass} == check ]]; then
++                    if [[ -L ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        :
++                    elif [[ -d ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        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}"
++                        errors=yes
++                    elif [[ -e ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        if [[ -n ${force} ]]; then
++                            write_warning_msg "Removing ${EROOT}${oldsymlinks[old_i]} due to --force: is not a symlink"
++                        else
++                            write_error_msg "Refusing to remove ${EROOT}${oldsymlinks[old_i]}: is not a symlink (use --force to override)"
++                            errors=yes
++                        fi
++                    fi
++
++                elif [[ ${pass} == perform ]]; then
++                    rm -f "${ROOT}${oldsymlinks[old_i]}" || die "${dieprefix}: rm failed"
++                else
++                    die "${dieprefix}: unknown \${pass} ${pass}???"
++                fi
++
++                old_i+=1
++
++            else
++                local target=${ALTERNATIVESDIR_ROOTLESS#/}/${ALTERNATIVE}/_current${newsymlinks[new_i]} dir=${newsymlinks[new_i]%/*}
++                while [[ -n ${dir} ]]; do
++                    target=../${target}
++                    dir=${dir%/*}
++                done
++
++                if [[ ${pass} == check ]]; then
++                    if [[ -L ${EROOT}${newsymlinks[new_i]} ]]; then
++                        :
++                    elif [[ -d ${EROOT}${newsymlinks[new_i]} ]]; then
++                        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}"
++                        errors=yes
++                    elif [[ -e ${EROOT}${newsymlinks[new_i]} ]]; then
++                        if [[ -n ${force} ]]; then
++                            write_warning_msg "Overwriting ${EROOT}${newsymlinks[new_i]} due to --force: is not a symlink"
++                        else
++                            write_error_msg "Refusing to overwrite ${EROOT}${newsymlinks[new_i]}: is not a symlink (use --force to override)"
++                            errors=yes
++                        fi
++                    fi
++
++                elif [[ ${pass} == perform ]]; then
++                    mkdir -p "${EROOT}${newsymlinks[new_i]%/*}" || die "${dieprefix}: mkdir -p failed"
++                    ln -snf "${target#/}" "${EROOT}${newsymlinks[new_i]}" || die "${dieprefix}: ln -snf failed"
++                else
++                    die "${dieprefix}: unknown \${pass} ${pass}???"
++                fi
++
++                [[ ${newsymlinks[new_i]} == ${oldsymlinks[old_i]} ]] && old_i+=1
++                new_i+=1
++            fi
++        done
++
++        [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++    done
++
++    local oldcur="$(get_current_provider)"
++    ln -snf "${provider}" "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: ln -snf failed"
++
++    : >"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: emptying/creating _current_list failed"
++    for symlink in "${newsymlinks[@]}"; do
++        echo -n -e "${symlink}\\0" >>"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: appending ${symlink} to _current_list failed"
++    done
++    return 0
++}
++
++_options_parameters() {
++    [[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
++    local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
++    if is_function ${describe_func}; then
++        IFS=$'\n'
++        options=( $(${describe_func}) )
++        IFS=$oldifs
++        for opt in "${options[@]}"; do
++            [[ ${opt} == --* ]] || continue
++            if [[ -n ${descriptions} ]]; then
++                echo "${opt/ : /:}"
++            else
++                echo "${opt%% : *}"
++            fi
++        done
++    fi
++}
++
++options_set() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++### update action ###
++
++describe_update() {
++    echo "Set a default provider if no valid one currently exists"
++}
++
++describe_update_parameters() {
++    echo "[--ignore] <provider>"
++}
++
++describe_update_options() {
++    echo "--ignore : update to any valid provider EXCEPT the specified provider"
++    echo "<provider> : the name of the provider to use"
++}
++
++do_update() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local p cur=$(get_current_provider) providers=( $(get_providers) ) ignore
++    if [[ "--ignore" == ${1} ]] ; then
++        # Try everything except setting the provider to the given
++        # one. So, if it isn't the given one, we end up doing
++        # nothing. Bug #128
++        shift
++        ignore=${1}
++    fi
++
++    if [[ ${cur} == ${1} && -z ${ignore} ]]; then
++        # if current provider was just updated, reselect it since it could have changed
++        do_set "${cur}" && return 0
++    elif [[ -n ${cur} && ${cur} != ${ignore} ]] ; then
++        # verify existing provider's symlinks
++        local p= bad=0
++        while read -r -d '' p ; do
++            [[ -L "${EROOT}${p}" && -e "${EROOT}${p}" ]] || (( bad++ ))
++        done < "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++        [[ "${bad}" -eq 0 ]] && return 0
++        # fix existing provider if possible
++        has "${cur}" "${providers[@]}" && do_set "${cur}" && return 0
++    elif has "${1}" "${providers[@]}" && [[ -z ${ignore} ]] ; then
++        # switch to new provider if none was set before or it can't be fixed
++        do_set "${1}" && return 0
++    fi
++
++    # if no valid provider has been selected switch to first available, valid
++    # provider, sorted according to importance
++    for p in "${providers[@]}"; do
++        [[ ${ignore} != ${p} ]] && do_set "${p}" && return 0
++    done
++
++    # if a provider is set but no providers are available anymore cleanup
++    cur=$(get_current_provider)
++    if [[ -n ${cur} ]]; then
++        do_unset "${cur}" && return 2
++    fi
++    # if no provider is set and none are available that are not ignored, return 2 for cleanup
++    [[ -z ${providers[@]} || ${providers[@]} == ${ignore} ]] && return 2
++
++    # we tried everything to select a valid provider, but failed
++    return 1
++}
++
++options_update() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++### unset action ###
++
++describe_unset() {
++    echo "Unset any symlinks created for the current provider for ${ALTERNATIVE}."
++}
++
++describe_unset_parameters() {
++    echo "[ --force ]"
++}
++
++describe_unset_options() {
++    echo "--force : remove existing non-symlink files (but not directories) if necessary"
++}
++
++do_unset() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local force=
++    if [[ ${1} == --force ]]; then
++        force=yes
++        shift
++    fi
++
++    local cur="$(get_current_provider)" p=
++    [[ -n "${cur}" ]] || die -q "Nothing to unset"
++    local dieprefix="Could not unset provider for ${ALTERNATIVE}"
++
++    local one=false symlink pass errors=
++    for pass in check perform; do
++        while read -r -d '' symlink; do
++            one=true
++            if [[ ${pass} == check ]]; then
++                if [[ -L ${EROOT}${symlink} ]]; then
++                    :
++                elif [[ -d ${EROOT}${symlink} ]]; then
++                    write_error_msg "Can't remove ${EROOT}${symlink}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
++                    errors=yes
++                elif [[ -e ${EROOT}${symlink} ]]; then
++                    if [[ -n ${force} ]]; then
++                        write_warning_msg "Removing ${EROOT}${symlink} due to --force: is not a symlink"
++                    else
++                        write_error_msg "Refusing to remove ${EROOT}${symlink}: is not a symlink (use --force to override)"
++                        errors=yes
++                    fi
++                fi
++
++            elif [[ ${pass} == perform ]]; then
++                rm -f "${EROOT}${symlink}" || die "${dieprefix}: rm failed"
++            else
++                die "${dieprefix}: unknown \${pass} ${pass}???"
++            fi
++        done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++        [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++    done
++
++    ${one} || die "${dieprefix}: does not provide any symlinks?"
++
++    rm "${ALTERNATIVESDIR}/${ALTERNATIVE}"/{_current,_current_list} || die "${dieprefix}: rm failed"
++}
++
++options_unset() {
++    _options_parameters $FUNCNAME "$@"
++    get_current_provider
++}
++
++### script action ###
++
++describe_script() {
++    echo "Output an evalable script fragment to set PATH, LD_LIBRARY_PATH and MANPATH to use the specified provider"
++}
++
++describe_script_parameters() {
++    echo "[--sh | --csh] [<provider>]"
++}
++
++describe_script_options() {
++    echo "--sh : use Bourne shell syntax (default)"
++    echo "--csh : use C shell syntax"
++    echo "<provider> : the provider to use or the index of the provider preceeded by a dash (if not specified, use the system default)"
++}
++
++do_script() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local syntax=sh provider providers
++    if [[ ${1} == --sh ]]; then
++        shift
++    elif [[ ${1} == --csh ]]; then
++        syntax=csh
++        shift
++    fi
++
++    if [[ ${1} == -+([[:digit:]]) ]]; then
++        providers=( $(get_providers) )
++        (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
++        provider=${providers[${1#-}-1]}
++    else
++        provider="${1}"
++    fi
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++
++    if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++        if is_number ${provider} ; then
++            providers=( $(get_providers) )
++            [[ -n ${providers[${1#-}-1]} ]] &&
++                die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
++        fi
++        die -q "The given provider (${provider}) does not exist"
++    fi
++
++    local variables=( PATH LD_LIBRARY_PATH MANPATH )
++    [[ -n ${!default_*} ]] && local ${!default_*}
++    local default_LD_LIBRARY_PATH=$(grep '^[^#]' "${EROOT}"/etc/ld.so.conf | tr '\n' ':')/lib:/usr/lib
++    local default_MANPATH=$(MANPATH= man -C"${EROOT}"/etc/man.conf -w)
++
++    local var IFS=:
++    for var in "${variables[@]}"; do
++        local defvar=default_${var} path paths=( )
++        for path in ${!var}; do
++            [[ ${path} == ${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/* ]] && continue
++            [[ -n ${provider} && -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++            paths+=( "${path}" )
++        done
++
++        [[ -n ${provider} ]] && for path in ${!defvar}; do
++            [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++        done
++
++        local newval=${paths[*]}
++        if [[ ${newval} != ${!var} ]]; then
++            newval=${newval//\'/\'\\\'\'}
++            if [[ ${syntax} == sh ]]; then
++                echo "${var}='${newval}'; export ${var}"
++            else
++                echo "setenv ${var} '${newval}'"
++            fi
++        fi
++    done
++}
++
++options_script() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2013-09-02 11:16 Andrew Savchenko
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Savchenko @ 2013-09-02 11:16 UTC (permalink / raw
  To: gentoo-commits

commit:     5e5578dee160428f92c73771ab1529bf089b4ea4
Author:     Andrew Savchenko <bircoph <AT> gmail <DOT> com>
AuthorDate: Mon Sep  2 11:15:14 2013 +0000
Commit:     Andrew Savchenko <bircoph <AT> gmail <DOT> com>
CommitDate: Mon Sep  2 11:15:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=5e5578de

app-admin/eselect: sync with portage version

---
 app-admin/eselect/ChangeLog                        |   6 +
 app-admin/eselect/eselect-1.3.8-r100.ebuild        |  72 +++
 .../eselect/files/eselect-1.3.8-alternatives.patch | 616 +++++++++++++++++++++
 3 files changed, 694 insertions(+)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index a6e5296..f016d96 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+*eselect-1.3.8-r100 (02 Sep 2013)
+
+  02 Sep 2013; Andrew Savchenko <bircoph@gmail.com> +eselect-1.3.8-r100.ebuild,
+  +files/eselect-1.3.8-alternatives.patch:
+  Bump to latest eselect.
+
   18 Jul 2013; Sébastien Fabbro <bicatali@gentoo.org> eselect-1.3.7-r100.ebuild:
   app-admin/eselect: Re-add emacs and vim flags
 

diff --git a/app-admin/eselect/eselect-1.3.8-r100.ebuild b/app-admin/eselect/eselect-1.3.8-r100.ebuild
new file mode 100644
index 0000000..3df9e37
--- /dev/null
+++ b/app-admin/eselect/eselect-1.3.8-r100.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit autotools eutils bash-completion-r1
+
+DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Eselect"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-2.5 )"
+SLOT="0"
+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"
+IUSE="doc emacs vim-syntax"
+
+RDEPEND="sys-apps/sed
+	|| (
+		sys-apps/coreutils
+		sys-freebsd/freebsd-bin
+		app-misc/realpath
+	)"
+DEPEND="${RDEPEND}
+	app-arch/xz-utils
+	doc? ( dev-python/docutils )"
+RDEPEND="!app-admin/eselect-news
+	${RDEPEND}
+	sys-apps/file
+	sys-libs/ncurses"
+
+PDEPEND="emacs? ( app-emacs/eselect-mode )
+	vim-syntax? ( app-vim/eselect-syntax )"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-alternatives.patch
+	AT_M4DIR="." eautoreconf
+}
+
+src_compile() {
+	emake
+	use doc && emake html
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+	newbashcomp misc/${PN}.bashcomp ${PN}
+	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
+	use doc && dohtml *.html doc/*
+
+	# needed by news module
+	keepdir /var/lib/gentoo/news
+	if ! use prefix; then
+		fowners root:portage /var/lib/gentoo/news
+		fperms g+w /var/lib/gentoo/news
+	fi
+
+	# band aid for prefix
+	if use prefix; then
+		cd "${ED}"/usr/share/eselect/libs
+		sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash || die
+	fi
+}
+
+pkg_postinst() {
+	# fowners in src_install doesn't work for the portage group:
+	# merging changes the group back to root
+	if ! use prefix; then
+		chgrp portage "${EROOT}/var/lib/gentoo/news" \
+			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+	fi
+}

diff --git a/app-admin/eselect/files/eselect-1.3.8-alternatives.patch b/app-admin/eselect/files/eselect-1.3.8-alternatives.patch
new file mode 100644
index 0000000..1e3b0ea
--- /dev/null
+++ b/app-admin/eselect/files/eselect-1.3.8-alternatives.patch
@@ -0,0 +1,616 @@
+Index: bin/eselect.in
+===================================================================
+--- bin/eselect.in	(revision 863)
++++ bin/eselect.in	(working copy)
+@@ -22,10 +22,15 @@
+ # Where are modules installed by default?
+ ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
+ 
++# Where are auto-generated modules placed? (e.g. from alternatives-2.eclass)
++ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
++
+ # Look in these places for modules
+-ESELECT_MODULES_PATH=( \
+-	"${HOME}/.eselect/modules" \
+-	"${ESELECT_DEFAULT_MODULES_PATH}" )
++ESELECT_MODULES_PATH=(
++	"${HOME}/.eselect/modules"
++	"${ESELECT_DEFAULT_MODULES_PATH}"
++	"${ESELECT_AUTO_GENERATED_MODULES_PATH}"
++)
+ 
+ # Look in this place for libraries
+ ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
+--- bin/Makefile.am.orig	2013-09-02 14:35:05.328684465 +0400
++++ bin/Makefile.am	2013-09-02 14:49:50.895842067 +0400
+@@ -4,6 +4,7 @@
+ dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
+ 	      -e 's,\@DATADIR\@,$(datadir),g' \
+ 	      -e 's,\@EPREFIX\@,$(EPREFIX),g' \
++	      -e 's,\@LIBEXECDIR\@,$(datadir),g' \
+ 	      -e 's,\@VERSION\@,$(VERSION)$(EXTRAVERSION),g'
+ 
+ % : %.in
+Index: libs/Makefile.am
+===================================================================
+--- libs/Makefile.am	(revision 863)
++++ libs/Makefile.am	(working copy)
+@@ -1,6 +1,7 @@
+ eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
+ 
+ eselectlibs_DATA = \
++	alternatives.bash \
+ 	config.bash \
+ 	core.bash \
+ 	default.eselect \
+@@ -14,6 +15,7 @@
+ 	tests.bash
+ 
+ EXTRA_DIST = \
++	alternatives.bash.in \
+ 	config.bash.in \
+ 	core.bash.in \
+ 	default.eselect.in \
+@@ -30,7 +32,8 @@
+ 	-e 's,\@SED\@,@SED@,g' \
+ 	-e 's,\@PORTAGEQ\@,@PORTAGEQ@,g' \
+ 	-e 's,\@ENV_UPDATE\@,@ENV_UPDATE@,g' \
+-	-e 's,\@CANONICALISE\@,@CANONICALISE@,g'
++	-e 's,\@CANONICALISE\@,@CANONICALISE@,g' \
++	-e 's,\@sysconfdir\@,@sysconfdir@,g'
+ 
+ %.bash : %.bash.in
+ 	@$(dosed) $< > $@
+--- libs/alternatives.bash.in.orig	1970-01-01 01:00:00.000000000 +0100
++++ libs/alternatives.bash.in	2011-09-06 18:55:43.000000000 +0100
+@@ -0,0 +1,550 @@
++# Copyright 2008 Mike Kelly
++# Copyright 2009 David Leverton
++# Copyright 2010 Bo Ørsted Andresen
++# 2010: Adapted to eselect Sebastien Fabbro (who doesn't like copyrights)
++# Distributed under the terms of the GNU General Public License v2
++
++inherit config output path-manipulation
++
++ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
++ALTERNATIVESDIR="${EROOT}${ALTERNATIVESDIR_ROOTLESS}"
++
++get_current_provider() {
++    local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
++    if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++        local provider=$(readlink "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: readlink ${symlink} failed")
++        [[ ${provider} == */* ]] && die "${dieprefix}: malformed target for ${symlink}"
++
++        if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ||
++                    ( -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} && ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ) ]]; then
++            die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} is not a directory"
++        fi
++
++        echo "${provider}"
++
++    elif [[ -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++        die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current is not a symlink"
++    fi
++}
++
++compare_importance() {
++    local IFS=.
++    local a=( ${1} ) b=( ${2} )
++    local -i i=0
++    while (( i<${#a[@]} && i<${#b[@]} )); do
++        if (( a[i]<b[i] )); then
++            return 0
++        elif (( a[i]>b[i] )); then
++            return 1
++        fi
++        i+=1
++    done
++    (( i<${#b[@]} ))
++}
++
++sort_providers() {
++    local begin=${1:-0}
++    local count=${2:-${#providers[@]}}
++    [[ ${count} -le 1 ]] && return 0
++    sort_providers ${begin} $((count/2))
++    sort_providers $((begin+count/2)) $((count-count/2))
++    local left=( "${providers[@]:begin:count/2}" )
++    local right=( "${providers[@]:begin+count/2:count-count/2}" )
++    local -i x i=0 j=0
++    for (( x=begin; x<begin+count; ++x )); do
++        if (( j>=${#right[@]} )) || { (( i<${#left[@]} )) && compare_importance "${left[i]%%:*}" "${right[j]%%:*}"; }; then
++            providers[x]=${left[i++]}
++        else
++            providers[x]=${right[j++]}
++        fi
++    done
++}
++
++get_providers() {
++    local p= importance providers=()
++    for p in "${ALTERNATIVESDIR}/${ALTERNATIVE}"/* ; do
++        [[ -d ${p} && ! -L ${p} ]] || continue
++        p=${p##*/}
++
++        importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
++        importance=${importance:-0}
++        [[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
++
++        providers+=( "${importance}:${p}" )
++    done
++
++    sort_providers
++    for (( p=${#providers[@]}-1 ; p>=0 ; --p )); do
++        echo "${providers[p]#*:}"
++    done
++}
++
++### show action ###
++describe_show() {
++    echo "Show the current provider in use for ${ALTERNATIVE}"
++}
++
++do_show() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local current="$(get_current_provider)"
++    if [[ -z "${current}" ]] ; then
++        echo "(none)"
++        return 2
++    fi
++    echo "${current}"
++}
++
++options_show() {
++    :
++}
++
++### list action ###
++describe_list() {
++    echo "Lists all available providers for ${ALTERNATIVE}"
++}
++
++do_list() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local n cur= providers=( $(get_providers) )
++    write_list_start "Available providers for ${ALTERNATIVE}:"
++
++    cur="$(get_current_provider)"
++
++    if [[ -n "${providers[@]}" ]] ; then
++        for (( n = 0 ; n < ${#providers[@]} ; ++n )) ; do
++            [[ ${cur} ==  "${providers[${n}]}" ]] && \
++                providers[${n}]="${providers[${n}]} $(highlight '*')"
++        done
++        write_numbered_list "${providers[@]}"
++    else
++        write_kv_list_entry "(none found)" ""
++    fi
++}
++
++options_list() {
++    :
++}
++
++### files action ###
++describe_files() {
++    echo "Lists symlinks provided by the currently selected provider"
++}
++
++do_files() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local cur="$(get_current_provider)" p=
++    [[ -n "${cur}" ]] || die -q "No selected provider, hence no symlinks provided"
++    local dieprefix="Could not list symlinks provided for ${ALTERNATIVE}"
++
++    local errors symlink rootsymlink
++    while read -r -d '' symlink; do
++        rootsymlink="${EROOT}${symlink}"
++        rootsymlink=${rootsymlink//+(\/)/\/}
++        echo "${rootsymlink}"
++        if [[ -L ${rootsymlink} ]]; then
++            if [[ ! -e ${rootsymlink} ]]; then
++                write_error_msg "${rootsymlink} is dangling symlink"
++                errors=yes
++            fi
++        elif [[ -d ${rootsymlink} ]]; then
++            write_error_msg "${rootsymlink} is a directory"
++            errors=yes
++        elif [[ -e ${rootsymlink} ]]; then
++            write_error_msg "${rootsymlink} exists but is not a symlink"
++            errors=yes
++        else
++            write_error_msg "${rootsymlink} does not exist"
++            errors=yes
++        fi
++    done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++}
++
++options_files() {
++    :
++}
++
++### set action ###
++
++describe_set() {
++    echo "Sets a provider for ${ALTERNATIVE}"
++}
++
++describe_set_parameters() {
++    echo "[ --force ] <provider>"
++}
++
++describe_set_options() {
++    echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
++    echo "<provider> : the name of the provider to use or the index of the provider preceeded by a dash"
++}
++
++do_set() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local force provider providers
++    if [[ ${1} == --force ]]; then
++        force=yes
++        shift
++    fi
++
++    if [[ ${1} == -+([[:digit:]]) ]]; then
++        providers=( $(get_providers) )
++        (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
++        provider=${providers[${1#-}-1]}
++    else
++        provider="${1}"
++    fi
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++    local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
++
++    if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++        if is_number ${provider} ; then
++            providers=( $(get_providers) )
++            [[ -n ${providers[${1#-}-1]} ]] &&
++                die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
++        fi
++        die -q "The given provider (${provider}) does not exist"
++    fi
++
++    local symlink newsymlinks=() oldsymlinks=()
++
++    while read -r -d '' symlink; do
++        local nicesymlink=${symlink#.}
++        nicesymlink=${nicesymlink//+(\/)/\/}
++        [[ ${nicesymlink} == /* ]] || die "${dieprefix}: bad symlink ${symlink}?"
++        [[ ${nicesymlink} == */ ]] && die "${dieprefix}: bad symlink ${symlink}?"
++
++        newsymlinks+=( "${nicesymlink}" )
++    done < <(
++        cd "${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}" || die "${dieprefix}: cd failed"
++        find . -type l -print0 | LC_ALL=C sort -r -u -z)
++    [[ ${#newsymlinks[@]} -gt 0 ]] || die "${dieprefix}: does not provide any symlinks?"
++
++    if [[ -f ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++        while read -r -d '' symlink; do
++            local nicesymlink=${symlink//+(\/)/\/}
++            [[ ${nicesymlink} == /* ]] || die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++            [[ ${nicesymlink} == */ ]] && die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++
++            oldsymlinks+=( "${nicesymlink}" )
++        done < <(LC_ALL=C sort -r -u -z "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list")
++        [[ ${#oldsymlinks[@]} -gt 0 ]] || die "${dieprefix}: old provider ${oldcur} does not provide any symlinks?"
++
++    elif [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list || -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++        die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list is not a file"
++    fi
++
++    local pass errors=
++    for pass in check perform; do
++        local -i new_i=0 old_i=0
++        while [[ -n ${newsymlinks[new_i]} || -n ${oldsymlinks[old_i]} ]]; do
++
++            if ( LC_ALL=C; [[ ${newsymlinks[new_i]} < ${oldsymlinks[old_i]} ]] ); then
++                if [[ ${pass} == check ]]; then
++                    if [[ -L ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        :
++                    elif [[ -d ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        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}"
++                        errors=yes
++                    elif [[ -e ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        if [[ -n ${force} ]]; then
++                            write_warning_msg "Removing ${EROOT}${oldsymlinks[old_i]} due to --force: is not a symlink"
++                        else
++                            write_error_msg "Refusing to remove ${EROOT}${oldsymlinks[old_i]}: is not a symlink (use --force to override)"
++                            errors=yes
++                        fi
++                    fi
++
++                elif [[ ${pass} == perform ]]; then
++                    rm -f "${ROOT}${oldsymlinks[old_i]}" || die "${dieprefix}: rm failed"
++                else
++                    die "${dieprefix}: unknown \${pass} ${pass}???"
++                fi
++
++                old_i+=1
++
++            else
++                local target=${ALTERNATIVESDIR_ROOTLESS#/}/${ALTERNATIVE}/_current${newsymlinks[new_i]} dir=${newsymlinks[new_i]%/*}
++                while [[ -n ${dir} ]]; do
++                    target=../${target}
++                    dir=${dir%/*}
++                done
++
++                if [[ ${pass} == check ]]; then
++                    if [[ -L ${EROOT}${newsymlinks[new_i]} ]]; then
++                        :
++                    elif [[ -d ${EROOT}${newsymlinks[new_i]} ]]; then
++                        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}"
++                        errors=yes
++                    elif [[ -e ${EROOT}${newsymlinks[new_i]} ]]; then
++                        if [[ -n ${force} ]]; then
++                            write_warning_msg "Overwriting ${EROOT}${newsymlinks[new_i]} due to --force: is not a symlink"
++                        else
++                            write_error_msg "Refusing to overwrite ${EROOT}${newsymlinks[new_i]}: is not a symlink (use --force to override)"
++                            errors=yes
++                        fi
++                    fi
++
++                elif [[ ${pass} == perform ]]; then
++                    mkdir -p "${EROOT}${newsymlinks[new_i]%/*}" || die "${dieprefix}: mkdir -p failed"
++                    ln -snf "${target#/}" "${EROOT}${newsymlinks[new_i]}" || die "${dieprefix}: ln -snf failed"
++                else
++                    die "${dieprefix}: unknown \${pass} ${pass}???"
++                fi
++
++                [[ ${newsymlinks[new_i]} == ${oldsymlinks[old_i]} ]] && old_i+=1
++                new_i+=1
++            fi
++        done
++
++        [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++    done
++
++    local oldcur="$(get_current_provider)"
++    ln -snf "${provider}" "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: ln -snf failed"
++
++    : >"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: emptying/creating _current_list failed"
++    for symlink in "${newsymlinks[@]}"; do
++        echo -n -e "${symlink}\\0" >>"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: appending ${symlink} to _current_list failed"
++    done
++    return 0
++}
++
++_options_parameters() {
++    [[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
++    local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
++    if is_function ${describe_func}; then
++        IFS=$'\n'
++        options=( $(${describe_func}) )
++        IFS=$oldifs
++        for opt in "${options[@]}"; do
++            [[ ${opt} == --* ]] || continue
++            if [[ -n ${descriptions} ]]; then
++                echo "${opt/ : /:}"
++            else
++                echo "${opt%% : *}"
++            fi
++        done
++    fi
++}
++
++options_set() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++### update action ###
++
++describe_update() {
++    echo "Set a default provider if no valid one currently exists"
++}
++
++describe_update_parameters() {
++    echo "[--ignore] <provider>"
++}
++
++describe_update_options() {
++    echo "--ignore : update to any valid provider EXCEPT the specified provider"
++    echo "<provider> : the name of the provider to use"
++}
++
++do_update() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local p cur=$(get_current_provider) providers=( $(get_providers) ) ignore
++    if [[ "--ignore" == ${1} ]] ; then
++        # Try everything except setting the provider to the given
++        # one. So, if it isn't the given one, we end up doing
++        # nothing. Bug #128
++        shift
++        ignore=${1}
++    fi
++
++    if [[ ${cur} == ${1} && -z ${ignore} ]]; then
++        # if current provider was just updated, reselect it since it could have changed
++        do_set "${cur}" && return 0
++    elif [[ -n ${cur} && ${cur} != ${ignore} ]] ; then
++        # verify existing provider's symlinks
++        local p= bad=0
++        while read -r -d '' p ; do
++            [[ -L "${EROOT}${p}" && -e "${EROOT}${p}" ]] || (( bad++ ))
++        done < "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++        [[ "${bad}" -eq 0 ]] && return 0
++        # fix existing provider if possible
++        has "${cur}" "${providers[@]}" && do_set "${cur}" && return 0
++    elif has "${1}" "${providers[@]}" && [[ -z ${ignore} ]] ; then
++        # switch to new provider if none was set before or it can't be fixed
++        do_set "${1}" && return 0
++    fi
++
++    # if no valid provider has been selected switch to first available, valid
++    # provider, sorted according to importance
++    for p in "${providers[@]}"; do
++        [[ ${ignore} != ${p} ]] && do_set "${p}" && return 0
++    done
++
++    # if a provider is set but no providers are available anymore cleanup
++    cur=$(get_current_provider)
++    if [[ -n ${cur} ]]; then
++        do_unset "${cur}" && return 2
++    fi
++    # if no provider is set and none are available that are not ignored, return 2 for cleanup
++    [[ -z ${providers[@]} || ${providers[@]} == ${ignore} ]] && return 2
++
++    # we tried everything to select a valid provider, but failed
++    return 1
++}
++
++options_update() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++### unset action ###
++
++describe_unset() {
++    echo "Unset any symlinks created for the current provider for ${ALTERNATIVE}."
++}
++
++describe_unset_parameters() {
++    echo "[ --force ]"
++}
++
++describe_unset_options() {
++    echo "--force : remove existing non-symlink files (but not directories) if necessary"
++}
++
++do_unset() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local force=
++    if [[ ${1} == --force ]]; then
++        force=yes
++        shift
++    fi
++
++    local cur="$(get_current_provider)" p=
++    [[ -n "${cur}" ]] || die -q "Nothing to unset"
++    local dieprefix="Could not unset provider for ${ALTERNATIVE}"
++
++    local one=false symlink pass errors=
++    for pass in check perform; do
++        while read -r -d '' symlink; do
++            one=true
++            if [[ ${pass} == check ]]; then
++                if [[ -L ${EROOT}${symlink} ]]; then
++                    :
++                elif [[ -d ${EROOT}${symlink} ]]; then
++                    write_error_msg "Can't remove ${EROOT}${symlink}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
++                    errors=yes
++                elif [[ -e ${EROOT}${symlink} ]]; then
++                    if [[ -n ${force} ]]; then
++                        write_warning_msg "Removing ${EROOT}${symlink} due to --force: is not a symlink"
++                    else
++                        write_error_msg "Refusing to remove ${EROOT}${symlink}: is not a symlink (use --force to override)"
++                        errors=yes
++                    fi
++                fi
++
++            elif [[ ${pass} == perform ]]; then
++                rm -f "${EROOT}${symlink}" || die "${dieprefix}: rm failed"
++            else
++                die "${dieprefix}: unknown \${pass} ${pass}???"
++            fi
++        done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++        [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++    done
++
++    ${one} || die "${dieprefix}: does not provide any symlinks?"
++
++    rm "${ALTERNATIVESDIR}/${ALTERNATIVE}"/{_current,_current_list} || die "${dieprefix}: rm failed"
++}
++
++options_unset() {
++    _options_parameters $FUNCNAME "$@"
++    get_current_provider
++}
++
++### script action ###
++
++describe_script() {
++    echo "Output an evalable script fragment to set PATH, LD_LIBRARY_PATH and MANPATH to use the specified provider"
++}
++
++describe_script_parameters() {
++    echo "[--sh | --csh] [<provider>]"
++}
++
++describe_script_options() {
++    echo "--sh : use Bourne shell syntax (default)"
++    echo "--csh : use C shell syntax"
++    echo "<provider> : the provider to use or the index of the provider preceeded by a dash (if not specified, use the system default)"
++}
++
++do_script() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local syntax=sh provider providers
++    if [[ ${1} == --sh ]]; then
++        shift
++    elif [[ ${1} == --csh ]]; then
++        syntax=csh
++        shift
++    fi
++
++    if [[ ${1} == -+([[:digit:]]) ]]; then
++        providers=( $(get_providers) )
++        (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
++        provider=${providers[${1#-}-1]}
++    else
++        provider="${1}"
++    fi
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++
++    if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++        if is_number ${provider} ; then
++            providers=( $(get_providers) )
++            [[ -n ${providers[${1#-}-1]} ]] &&
++                die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
++        fi
++        die -q "The given provider (${provider}) does not exist"
++    fi
++
++    local variables=( PATH LD_LIBRARY_PATH MANPATH )
++    [[ -n ${!default_*} ]] && local ${!default_*}
++    local default_LD_LIBRARY_PATH=$(grep '^[^#]' "${EROOT}"/etc/ld.so.conf | tr '\n' ':')/lib:/usr/lib
++    local default_MANPATH=$(MANPATH= man -C"${EROOT}"/etc/man.conf -w)
++
++    local var IFS=:
++    for var in "${variables[@]}"; do
++        local defvar=default_${var} path paths=( )
++        for path in ${!var}; do
++            [[ ${path} == ${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/* ]] && continue
++            [[ -n ${provider} && -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++            paths+=( "${path}" )
++        done
++
++        [[ -n ${provider} ]] && for path in ${!defvar}; do
++            [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++        done
++
++        local newval=${paths[*]}
++        if [[ ${newval} != ${!var} ]]; then
++            newval=${newval//\'/\'\\\'\'}
++            if [[ ${syntax} == sh ]]; then
++                echo "${var}='${newval}'; export ${var}"
++            else
++                echo "setenv ${var} '${newval}'"
++            fi
++        fi
++    done
++}
++
++options_script() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2013-01-24 19:47 Sebastien Fabbro
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastien Fabbro @ 2013-01-24 19:47 UTC (permalink / raw
  To: gentoo-commits

commit:     98ecdf6fdd7f7b4af222e44d5cf58664a26c96f1
Author:     Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 24 18:30:38 2013 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Thu Jan 24 18:30:38 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=98ecdf6f

app-admin/eselect: Cleaned old

Package-Manager: portage-2.2.01.21580-prefix
RepoMan-Options: --force

---
 app-admin/eselect/ChangeLog                       |    6 ++-
 app-admin/eselect/eselect-1.3.2-r100.ebuild       |   80 ---------------------
 app-admin/eselect/eselect-1.3.3-r100.ebuild       |   79 --------------------
 app-admin/eselect/files/eselect-1.3.2-eroot.patch |   11 ---
 app-admin/eselect/metadata.xml                    |    6 +-
 5 files changed, 8 insertions(+), 174 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index 3b9e2fe..d7f25de 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,11 @@
 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+  24 Jan 2013; Sébastien Fabbro <bicatali@gentoo.org>
+  -eselect-1.3.2-r100.ebuild, -eselect-1.3.3-r100.ebuild,
+  -files/eselect-1.3.2-eroot.patch, metadata.xml:
+  app-admin/eselect: Cleaned old
+
 *eselect-1.3.4-r100 (07 Jan 2013)
 
   07 Jan 2013; Justin Lecher <jlec@gentoo.org> +eselect-1.3.4-r100.ebuild,
@@ -797,4 +802,3 @@
   08 May 2005; Aaron Walker <ka0ttic@gentoo.org> +metadata.xml,
   +eclectic-0.9.1.ebuild:
   Initial commit.
-

diff --git a/app-admin/eselect/eselect-1.3.2-r100.ebuild b/app-admin/eselect/eselect-1.3.2-r100.ebuild
deleted file mode 100644
index f26fecb..0000000
--- a/app-admin/eselect/eselect-1.3.2-r100.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/eselect-1.3.ebuild,v 1.1 2012/01/21 19:02:55 ulm Exp $
-
-EAPI=3
-
-inherit autotools eutils bash-completion-r1
-
-DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
-SRC_URI="mirror://gentoo/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-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 ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc"
-
-RDEPEND="sys-apps/sed
-	|| (
-		sys-apps/coreutils
-		sys-freebsd/freebsd-bin
-		app-misc/realpath
-	)"
-DEPEND="${RDEPEND}
-	app-arch/xz-utils
-	doc? ( dev-python/docutils )"
-RDEPEND="!app-admin/eselect-news
-	${RDEPEND}
-	sys-apps/file
-	sys-libs/ncurses"
-
-# Commented out: only few users of eselect will edit its source
-#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
-#	vim-syntax? ( app-vim/eselect-syntax )"
-
-src_prepare() {
-	epatch "${FILESDIR}/${P}-eroot.patch"
-	epatch "${FILESDIR}"/${PN}-alternatives.patch
-	AT_M4DIR="." eautoreconf
-}
-
-src_compile() {
-	emake || die
-
-	if use doc; then
-		emake html || die
-	fi
-}
-
-src_install() {
-	emake DESTDIR="${D}" install || die
-	newbashcomp misc/${PN}.bashcomp ${PN} || die
-	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt || die
-
-	if use doc; then
-		dohtml *.html doc/* || die
-	fi
-
-	# needed by news module
-	keepdir /var/lib/gentoo/news
-	if ! use prefix; then
-		fowners root:portage /var/lib/gentoo/news || die
-		fperms g+w /var/lib/gentoo/news || die
-	fi
-
-	# band aid for prefix
-	if use prefix; then
-		cd "${ED}"/usr/share/eselect/libs
-		sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash
-	fi
-}
-
-pkg_postinst() {
-	# fowners in src_install doesn't work for the portage group:
-	# merging changes the group back to root
-	if ! use prefix; then
-		chgrp portage "${EROOT}/var/lib/gentoo/news" \
-			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
-	fi
-}

diff --git a/app-admin/eselect/eselect-1.3.3-r100.ebuild b/app-admin/eselect/eselect-1.3.3-r100.ebuild
deleted file mode 100644
index a506f0a..0000000
--- a/app-admin/eselect/eselect-1.3.3-r100.ebuild
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/eselect-1.3.ebuild,v 1.1 2012/01/21 19:02:55 ulm Exp $
-
-EAPI=3
-
-inherit autotools eutils bash-completion-r1
-
-DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
-HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
-SRC_URI="mirror://gentoo/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-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 ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc"
-
-RDEPEND="sys-apps/sed
-	|| (
-		sys-apps/coreutils
-		sys-freebsd/freebsd-bin
-		app-misc/realpath
-	)"
-DEPEND="${RDEPEND}
-	app-arch/xz-utils
-	doc? ( dev-python/docutils )"
-RDEPEND="!app-admin/eselect-news
-	${RDEPEND}
-	sys-apps/file
-	sys-libs/ncurses"
-
-# Commented out: only few users of eselect will edit its source
-#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
-#	vim-syntax? ( app-vim/eselect-syntax )"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-alternatives.patch
-	AT_M4DIR="." eautoreconf
-}
-
-src_compile() {
-	emake || die
-
-	if use doc; then
-		emake html || die
-	fi
-}
-
-src_install() {
-	emake DESTDIR="${D}" install || die
-	newbashcomp misc/${PN}.bashcomp ${PN} || die
-	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt || die
-
-	if use doc; then
-		dohtml *.html doc/* || die
-	fi
-
-	# needed by news module
-	keepdir /var/lib/gentoo/news
-	if ! use prefix; then
-		fowners root:portage /var/lib/gentoo/news || die
-		fperms g+w /var/lib/gentoo/news || die
-	fi
-
-	# band aid for prefix
-	if use prefix; then
-		cd "${ED}"/usr/share/eselect/libs
-		sed -i "s:ALTERNATIVESDIR_ROOTLESS=\"${EPREFIX}:ALTERNATIVESDIR_ROOTLESS=\":" alternatives.bash
-	fi
-}
-
-pkg_postinst() {
-	# fowners in src_install doesn't work for the portage group:
-	# merging changes the group back to root
-	if ! use prefix; then
-		chgrp portage "${EROOT}/var/lib/gentoo/news" \
-			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
-	fi
-}

diff --git a/app-admin/eselect/files/eselect-1.3.2-eroot.patch b/app-admin/eselect/files/eselect-1.3.2-eroot.patch
deleted file mode 100644
index 81e5bb6..0000000
--- a/app-admin/eselect/files/eselect-1.3.2-eroot.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/bin/eselect.in
-+++ b/bin/eselect.in
-@@ -43,7 +43,7 @@
- 
- # Support variables for Gentoo Prefix
- EPREFIX="@EPREFIX@"
--EROOT="${ROOT%/}${EPREFIX}"
-+EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
- 
- # Remove all alias definitions. Unset functions and variables that are
- # known to cause trouble.

diff --git a/app-admin/eselect/metadata.xml b/app-admin/eselect/metadata.xml
index 33d01aa..d9f09c8 100644
--- a/app-admin/eselect/metadata.xml
+++ b/app-admin/eselect/metadata.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-  <maintainer>
-    <email>bicatali@gentoo.org</email>
-  </maintainer>
+<maintainer>
+  <email>bicatali@gentoo.org</email>
+</maintainer>
 </pkgmetadata>


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2012-09-20 21:25 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2012-09-20 21:25 UTC (permalink / raw
  To: gentoo-commits

commit:     f59f0441fff322533f04a5205c30665b2ec02178
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 20 21:25:01 2012 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Sep 20 21:25:01 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=f59f0441

Version Bump

---
 app-admin/eselect/ChangeLog                        |    6 ++++++
 ...ect-1.3.1-r1.ebuild => eselect-1.3.2-r1.ebuild} |   18 +++++++++++-------
 app-admin/eselect/files/eselect-1.3.2-eroot.patch  |   11 +++++++++++
 3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index 99f036e..ecfbe1a 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+*eselect-1.3.2-r1 (20 Sep 2012)
+
+  20 Sep 2012; Justin Lecher <jlec@gentoo.org> -eselect-1.3.1-r1.ebuild,
+  +eselect-1.3.2-r1.ebuild, +files/eselect-1.3.2-eroot.patch:
+  Version BUmp
+
   04 Jun 2012; Justin Lecher <jlec@gentoo.org> eselect-1.3.1-r1.ebuild,
   metadata.xml:
   Fix eaclocal call

diff --git a/app-admin/eselect/eselect-1.3.1-r1.ebuild b/app-admin/eselect/eselect-1.3.2-r1.ebuild
similarity index 73%
rename from app-admin/eselect/eselect-1.3.1-r1.ebuild
rename to app-admin/eselect/eselect-1.3.2-r1.ebuild
index 1bbfdb5..f26fecb 100644
--- a/app-admin/eselect/eselect-1.3.1-r1.ebuild
+++ b/app-admin/eselect/eselect-1.3.2-r1.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=3
 
-inherit bash-completion-r1 eutils autotools
+inherit autotools eutils bash-completion-r1
 
 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
 HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
@@ -12,7 +12,7 @@ SRC_URI="mirror://gentoo/${P}.tar.xz"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+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 ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
 IUSE="doc"
 
 RDEPEND="sys-apps/sed
@@ -34,6 +34,7 @@ RDEPEND="!app-admin/eselect-news
 #	vim-syntax? ( app-vim/eselect-syntax )"
 
 src_prepare() {
+	epatch "${FILESDIR}/${P}-eroot.patch"
 	epatch "${FILESDIR}"/${PN}-alternatives.patch
 	AT_M4DIR="." eautoreconf
 }
@@ -57,8 +58,10 @@ src_install() {
 
 	# needed by news module
 	keepdir /var/lib/gentoo/news
-	fowners root:portage /var/lib/gentoo/news || die
-	fperms g+w /var/lib/gentoo/news || die
+	if ! use prefix; then
+		fowners root:portage /var/lib/gentoo/news || die
+		fperms g+w /var/lib/gentoo/news || die
+	fi
 
 	# band aid for prefix
 	if use prefix; then
@@ -70,7 +73,8 @@ src_install() {
 pkg_postinst() {
 	# fowners in src_install doesn't work for the portage group:
 	# merging changes the group back to root
-	[[ -z ${EROOT} ]] && local EROOT=${ROOT}
-	chgrp portage "${EROOT}/var/lib/gentoo/news" \
-		&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+	if ! use prefix; then
+		chgrp portage "${EROOT}/var/lib/gentoo/news" \
+			&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+	fi
 }

diff --git a/app-admin/eselect/files/eselect-1.3.2-eroot.patch b/app-admin/eselect/files/eselect-1.3.2-eroot.patch
new file mode 100644
index 0000000..81e5bb6
--- /dev/null
+++ b/app-admin/eselect/files/eselect-1.3.2-eroot.patch
@@ -0,0 +1,11 @@
+--- a/bin/eselect.in
++++ b/bin/eselect.in
+@@ -43,7 +43,7 @@
+ 
+ # Support variables for Gentoo Prefix
+ EPREFIX="@EPREFIX@"
+-EROOT="${ROOT%/}${EPREFIX}"
++EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
+ 
+ # Remove all alias definitions. Unset functions and variables that are
+ # known to cause trouble.


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2012-01-22 22:16 Sebastien Fabbro
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastien Fabbro @ 2012-01-22 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     44bb7330d5a883f895e18f54ab4cd9a6677bcea4
Author:     Sébastien Fabbro <sebfabbro <AT> gmail <DOT> com>
AuthorDate: Sun Jan 22 22:16:00 2012 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Sun Jan 22 22:16:00 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=44bb7330

app-admin/eselect: merge with main tree

(Portage version: 2.1.10.41/git/Linux x86_64, unsigned Manifest commit)

---
 app-admin/eselect/ChangeLog                        |    9 ++-
 ...lect-1.2.18-r1.ebuild => eselect-1.3-r1.ebuild} |   11 ++-
 app-admin/eselect/files/eselect-alternatives.patch |   86 ++++++++++----------
 app-admin/eselect/metadata.xml                     |    3 +-
 4 files changed, 59 insertions(+), 50 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index 2b3430a..e9b609f 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -1,7 +1,14 @@
 # ChangeLog for app-admin/eselect
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+*eselect-1.3-r1 (22 Jan 2012)
+
+  22 Jan 2012; Sébastien Fabbro <bicatali@gentoo.org>
+  -eselect-1.2.18-r1.ebuild, +eselect-1.3-r1.ebuild,
+  files/eselect-alternatives.patch, metadata.xml:
+  merge with main tree
+
 *eselect-1.2.18-r1 (27 Sep 2011)
 
   27 Sep 2011; Alexey Shvetsov <alexxy@gentoo.org> -eselect-1.2.17-r1.ebuild,

diff --git a/app-admin/eselect/eselect-1.2.18-r1.ebuild b/app-admin/eselect/eselect-1.3-r1.ebuild
similarity index 82%
rename from app-admin/eselect/eselect-1.2.18-r1.ebuild
rename to app-admin/eselect/eselect-1.3-r1.ebuild
index 483018a..7ca2190 100644
--- a/app-admin/eselect/eselect-1.2.18-r1.ebuild
+++ b/app-admin/eselect/eselect-1.3-r1.ebuild
@@ -1,14 +1,14 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/eselect-1.2.18.ebuild,v 1.1 2011/09/25 16:24:18 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/eselect-1.3.ebuild,v 1.1 2012/01/21 19:02:55 ulm Exp $
 
 EAPI=3
 
-inherit autotools bash-completion-r1 eutils
+inherit bash-completion-r1 eutils autotools
 
 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
 HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
-SRC_URI="mirror://gentoo/${P}.tar.bz2"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -22,6 +22,7 @@ RDEPEND="sys-apps/sed
 		app-misc/realpath
 	)"
 DEPEND="${RDEPEND}
+	app-arch/xz-utils
 	doc? ( dev-python/docutils )"
 RDEPEND="!app-admin/eselect-news
 	${RDEPEND}
@@ -56,6 +57,8 @@ src_install() {
 
 	# needed by news module
 	keepdir /var/lib/gentoo/news
+	fowners root:portage /var/lib/gentoo/news || die
+	fperms g+w /var/lib/gentoo/news || die
 }
 
 pkg_postinst() {

diff --git a/app-admin/eselect/files/eselect-alternatives.patch b/app-admin/eselect/files/eselect-alternatives.patch
index a21632b..1aafdb0 100644
--- a/app-admin/eselect/files/eselect-alternatives.patch
+++ b/app-admin/eselect/files/eselect-alternatives.patch
@@ -1,48 +1,6 @@
-Index: libs/Makefile.am
-===================================================================
---- libs/Makefile.am	(revision 837)
-+++ libs/Makefile.am	(working copy)
-@@ -1,6 +1,7 @@
- eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
- 
- eselectlibs_DATA = \
-+		   alternatives.bash \
- 		   config.bash \
- 		   core.bash \
- 		   default.eselect \
-@@ -14,6 +15,7 @@
- 		   tests.bash
- 
- EXTRA_DIST = \
-+	     alternatives.bash.in \
- 	     config.bash.in \
- 	     core.bash.in \
- 	     default.eselect.in \
-@@ -30,7 +32,8 @@
- 	-e 's,\@SED\@,@SED@,g' \
- 	-e 's,\@PORTAGEQ\@,@PORTAGEQ@,g' \
- 	-e 's,\@ENV_UPDATE\@,@ENV_UPDATE@,g' \
--	-e 's,\@CANONICALISE\@,@CANONICALISE@,g'
-+	-e 's,\@CANONICALISE\@,@CANONICALISE@,g' \
-+	-e 's,\@sysconfdir\@,@sysconfdir@,g'
- 
- %.bash : %.bash.in
- 	@$(dosed) $< > $@
-Index: bin/Makefile.am
-===================================================================
---- bin/Makefile.am	(revision 837)
-+++ bin/Makefile.am	(working copy)
-@@ -4,6 +4,7 @@
- dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
- 	      -e 's,\@DATADIR\@,$(datadir),g' \
- 	      -e 's,\@EPREFIX\@,$(EPREFIX),g' \
-+	      -e 's,\@LIBEXECDIR\@,$(datadir),g' \
- 	      -e 's,\@VERSION\@,$(VERSION),g'
- 
- % : %.in
 Index: bin/eselect.in
 ===================================================================
---- bin/eselect.in	(revision 837)
+--- bin/eselect.in	(revision 863)
 +++ bin/eselect.in	(working copy)
 @@ -22,10 +22,15 @@
  # Where are modules installed by default?
@@ -63,6 +21,48 @@ Index: bin/eselect.in
  
  # Look in this place for libraries
  ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
+Index: bin/Makefile.am
+===================================================================
+--- bin/Makefile.am	(revision 863)
++++ bin/Makefile.am	(working copy)
+@@ -4,6 +4,7 @@
+ dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
+ 	      -e 's,\@DATADIR\@,$(datadir),g' \
+ 	      -e 's,\@EPREFIX\@,$(EPREFIX),g' \
++	      -e 's,\@LIBEXECDIR\@,$(datadir),g' \
+ 	      -e 's,\@VERSION\@,$(VERSION),g'
+ 
+ % : %.in
+Index: libs/Makefile.am
+===================================================================
+--- libs/Makefile.am	(revision 863)
++++ libs/Makefile.am	(working copy)
+@@ -1,6 +1,7 @@
+ eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
+ 
+ eselectlibs_DATA = \
++	alternatives.bash \
+ 	config.bash \
+ 	core.bash \
+ 	default.eselect \
+@@ -14,6 +15,7 @@
+ 	tests.bash
+ 
+ EXTRA_DIST = \
++	alternatives.bash.in \
+ 	config.bash.in \
+ 	core.bash.in \
+ 	default.eselect.in \
+@@ -30,7 +32,8 @@
+ 	-e 's,\@SED\@,@SED@,g' \
+ 	-e 's,\@PORTAGEQ\@,@PORTAGEQ@,g' \
+ 	-e 's,\@ENV_UPDATE\@,@ENV_UPDATE@,g' \
+-	-e 's,\@CANONICALISE\@,@CANONICALISE@,g'
++	-e 's,\@CANONICALISE\@,@CANONICALISE@,g' \
++	-e 's,\@sysconfdir\@,@sysconfdir@,g'
+ 
+ %.bash : %.bash.in
+ 	@$(dosed) $< > $@
 --- libs/alternatives.bash.in.orig	1970-01-01 01:00:00.000000000 +0100
 +++ libs/alternatives.bash.in	2011-09-06 18:55:43.000000000 +0100
 @@ -0,0 +1,550 @@

diff --git a/app-admin/eselect/metadata.xml b/app-admin/eselect/metadata.xml
index dbaf8c8..d9f09c8 100644
--- a/app-admin/eselect/metadata.xml
+++ b/app-admin/eselect/metadata.xml
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<herd>no-herd</herd>
 <maintainer>
-  <email>eselect@gentoo.org</email>
+  <email>bicatali@gentoo.org</email>
 </maintainer>
 </pkgmetadata>



^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2011-09-06 18:04 Sebastien Fabbro
  0 siblings, 0 replies; 15+ messages in thread
From: Sebastien Fabbro @ 2011-09-06 18:04 UTC (permalink / raw
  To: gentoo-commits

commit:     5ac6dea03a20b7d9f470d69f9652b0568f649ac5
Author:     Sébastien Fabbro <sebfabbro <AT> gmail <DOT> com>
AuthorDate: Tue Sep  6 18:04:48 2011 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Tue Sep  6 18:04:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=5ac6dea0

prefix fix and number update

---
 app-admin/eselect/ChangeLog                        |    4 +
 app-admin/eselect/files/eselect-alternatives.patch |   65 ++++++++++++-------
 2 files changed, 45 insertions(+), 24 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
index c48d200..5c16c2f 100644
--- a/app-admin/eselect/ChangeLog
+++ b/app-admin/eselect/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
 
+  06 Sep 2011; Sébastien Fabbro <bicatali@gentoo.org>
+  files/eselect-alternatives.patch:
+  Updated to newer eclectic alternatives. Fixed a prefix thanks Francois Bissey
+
 *eselect-1.2.17-r1 (06 Sep 2011)
 
   06 Sep 2011; Sébastien Fabbro <bicatali@gentoo.org>

diff --git a/app-admin/eselect/files/eselect-alternatives.patch b/app-admin/eselect/files/eselect-alternatives.patch
index 9914980..a21632b 100644
--- a/app-admin/eselect/files/eselect-alternatives.patch
+++ b/app-admin/eselect/files/eselect-alternatives.patch
@@ -1,6 +1,6 @@
 Index: libs/Makefile.am
 ===================================================================
---- libs/Makefile.am	(revision 803)
+--- libs/Makefile.am	(revision 837)
 +++ libs/Makefile.am	(working copy)
 @@ -1,6 +1,7 @@
  eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
@@ -30,7 +30,7 @@ Index: libs/Makefile.am
  	@$(dosed) $< > $@
 Index: bin/Makefile.am
 ===================================================================
---- bin/Makefile.am	(revision 803)
+--- bin/Makefile.am	(revision 837)
 +++ bin/Makefile.am	(working copy)
 @@ -4,6 +4,7 @@
  dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
@@ -42,7 +42,7 @@ Index: bin/Makefile.am
  % : %.in
 Index: bin/eselect.in
 ===================================================================
---- bin/eselect.in	(revision 803)
+--- bin/eselect.in	(revision 837)
 +++ bin/eselect.in	(working copy)
 @@ -22,10 +22,15 @@
  # Where are modules installed by default?
@@ -64,8 +64,8 @@ Index: bin/eselect.in
  # Look in this place for libraries
  ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
 --- libs/alternatives.bash.in.orig	1970-01-01 01:00:00.000000000 +0100
-+++ libs/alternatives.bash.in	2010-12-15 19:37:54.000000000 +0000
-@@ -0,0 +1,533 @@
++++ libs/alternatives.bash.in	2011-09-06 18:55:43.000000000 +0100
+@@ -0,0 +1,550 @@
 +# Copyright 2008 Mike Kelly
 +# Copyright 2009 David Leverton
 +# Copyright 2010 Bo Ørsted Andresen
@@ -75,7 +75,7 @@ Index: bin/eselect.in
 +inherit config output path-manipulation
 +
 +ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
-+ALTERNATIVESDIR="${EROOT}${ALTERNATIVESDIR_ROOTLESS}"
++ALTERNATIVESDIR="${ALTERNATIVESDIR_ROOTLESS}"
 +
 +get_current_provider() {
 +    local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
@@ -244,29 +244,36 @@ Index: bin/eselect.in
 +
 +describe_set_options() {
 +    echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
-+    echo "<provider> : the name of the provider to use"
++    echo "<provider> : the name of the provider to use or the index of the provider preceeded by a dash"
 +}
 +
 +do_set() {
 +    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
 +
-+    local force=
++    local force provider providers
 +    if [[ ${1} == --force ]]; then
 +        force=yes
 +        shift
 +    fi
 +
-+    local provider="${1}"
-+    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
-+    if is_number "${provider}" ; then
-+        local providers=( $(get_providers) )
-+        (( ${provider} <= ${#providers[@]} )) || die -q "The given provider (${provider}) does not exist"
-+        provider=${providers[${provider}-1]}
++    if [[ ${1} == -+([[:digit:]]) ]]; then
++        providers=( $(get_providers) )
++        (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
++        provider=${providers[${1#-}-1]}
++    else
++        provider="${1}"
 +    fi
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
 +    local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
 +
-+    [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] \
-+        || die -q "The given provider (${provider}) does not exist"
++    if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++        if is_number ${provider} ; then
++            providers=( $(get_providers) )
++            [[ -n ${providers[${1#-}-1]} ]] &&
++                die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
++        fi
++        die -q "The given provider (${provider}) does not exist"
++    fi
 +
 +    local symlink newsymlinks=() oldsymlinks=()
 +
@@ -542,26 +549,36 @@ Index: bin/eselect.in
 +describe_script_options() {
 +    echo "--sh : use Bourne shell syntax (default)"
 +    echo "--csh : use C shell syntax"
-+    echo "<provider> : the provider to use (if not specified, use the system default)"
++    echo "<provider> : the provider to use or the index of the provider preceeded by a dash (if not specified, use the system default)"
 +}
 +
 +do_script() {
 +    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
-+    local syntax=sh
++    local syntax=sh provider providers
 +    if [[ ${1} == --sh ]]; then
 +        shift
 +    elif [[ ${1} == --csh ]]; then
 +        syntax=csh
 +        shift
 +    fi
-+    local provider=${1}
++
++    if [[ ${1} == -+([[:digit:]]) ]]; then
++        providers=( $(get_providers) )
++        (( ${1#-} <= ${#providers[@]} )) || die -q "The given provider with index (${1#-}) does not exist"
++        provider=${providers[${1#-}-1]}
++    else
++        provider="${1}"
++    fi
 +    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
-+    if is_number "${provider}" ; then
-+        local providers=( $(get_providers) )
-+        (( ${provider} <= ${#providers[@]} )) || die -q "The given provider (${provider}) does not exist"
-+        provider=${providers[${provider}-1]}
++
++    if [[ ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] ; then
++        if is_number ${provider} ; then
++            providers=( $(get_providers) )
++            [[ -n ${providers[${1#-}-1]} ]] &&
++                die -q "The given provider (${provider}) does not exist, did you mean -${provider} (${providers[${1#-}-1]})?"
++        fi
++        die -q "The given provider (${provider}) does not exist"
 +    fi
-+    [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] || die -q "The given provider (${provider}) does not exist"
 +
 +    local variables=( PATH LD_LIBRARY_PATH MANPATH )
 +    [[ -n ${!default_*} ]] && local ${!default_*}



^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/
@ 2011-08-03 23:37 Andrea Arteaga
  0 siblings, 0 replies; 15+ messages in thread
From: Andrea Arteaga @ 2011-08-03 23:37 UTC (permalink / raw
  To: gentoo-commits

commit:     6c8e37edc94f81ac07db147022739bc2865ea507
Author:     spiros <andyspiros <AT> gmail <DOT> com>
AuthorDate: Wed Aug  3 23:37:08 2011 +0000
Commit:     Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Wed Aug  3 23:37:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=6c8e37ed

eselect-1.2.16-r1 imported from the bicatali overlay

---
 app-admin/eselect/ChangeLog                        |  739 ++++++++++++++++++++
 app-admin/eselect/eselect-1.2.16-r1.ebuild         |   64 ++
 app-admin/eselect/files/eselect-alternatives.patch |  601 ++++++++++++++++
 app-admin/eselect/metadata.xml                     |    8 +
 4 files changed, 1412 insertions(+), 0 deletions(-)

diff --git a/app-admin/eselect/ChangeLog b/app-admin/eselect/ChangeLog
new file mode 100644
index 0000000..cde504e
--- /dev/null
+++ b/app-admin/eselect/ChangeLog
@@ -0,0 +1,739 @@
+# ChangeLog for app-admin/eselect
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect/ChangeLog,v 1.179 2011/01/22 21:38:52 ulm Exp $
+
+*eselect-1.2.16-r1
+
+  03 Aug 2011; Andrea Arteaga <andyspiros@gmail.com>
+  Imported from dev/bicatali
+
+  22 Jan 2011; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.10.ebuild,
+  -eselect-1.2.13.ebuild:
+  Remove old.
+
+  22 Jan 2011; Kacper Kowalik <xarthisius@gentoo.org> eselect-1.2.11.ebuild:
+  ppc64 stable wrt #344537
+
+*eselect-1.2.14 (14 Jan 2011)
+
+  14 Jan 2011; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2.14.ebuild:
+  Version bump.
+
+*eselect-1.2.13 (27 Nov 2010)
+
+  27 Nov 2010; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.12.ebuild,
+  +eselect-1.2.13.ebuild:
+  Version bump, fixes bug 346837. Remove intermediate version.
+
+*eselect-1.2.12 (21 Nov 2010)
+
+  21 Nov 2010; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2.12.ebuild:
+  Version bump.
+
+  14 Nov 2010; Raúl Porcel <armin76@gentoo.org> eselect-1.2.11.ebuild:
+  alpha/ia64/m68k/s390/sh/sparc stable wrt #344537
+
+  09 Nov 2010; Markus Meier <maekke@gentoo.org> eselect-1.2.11.ebuild:
+  arm stable, bug #344537
+
+  09 Nov 2010; Jeroen Roovers <jer@gentoo.org> eselect-1.2.11.ebuild:
+  Stable for PPC (bug #344537).
+
+  09 Nov 2010; Jeroen Roovers <jer@gentoo.org> eselect-1.2.11.ebuild:
+  Stable for HPPA (bug #344537).
+
+  08 Nov 2010; Markos Chandras <hwoarang@gentoo.org> eselect-1.2.11.ebuild:
+  Stable on amd64 wrt bug #344537
+
+  08 Nov 2010; Christian Faulhammer <fauli@gentoo.org>
+  eselect-1.2.11.ebuild:
+  stable x86, bug 344537
+
+  23 Oct 2010; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.9.ebuild:
+  Remove old.
+
+  23 Oct 2010; Mark Loeser <halcy0n@gentoo.org> eselect-1.2.10.ebuild:
+  Mark ppc64; bug #313829
+
+*eselect-1.2.11 (27 Jul 2010)
+
+  27 Jul 2010; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.8.ebuild,
+  +eselect-1.2.11.ebuild:
+  Version bump. Remove old.
+
+  23 May 2010; Pacho Ramos <pacho@gentoo.org> eselect-1.2.10.ebuild:
+  stable amd64, bug 313829
+
+  08 May 2010; Raúl Porcel <armin76@gentoo.org> eselect-1.2.10.ebuild:
+  alpha/arm/ia64/m68k/s390/sh stable wrt #313829
+
+  16 Apr 2010; Brent Baude <ranger@gentoo.org> eselect-1.2.10.ebuild:
+  stable ppc, bug 313829
+
+  09 Apr 2010; Tiago Cunha <tcunha@gentoo.org> eselect-1.2.10.ebuild:
+  stable sparc, bug 313829
+
+  09 Apr 2010; Jeroen Roovers <jer@gentoo.org> eselect-1.2.10.ebuild:
+  Stable for HPPA (bug #313829).
+
+  08 Apr 2010; Christian Faulhammer <fauli@gentoo.org>
+  eselect-1.2.10.ebuild:
+  stable x86, bug 313829
+
+  10 Feb 2010; Joseph Jezak <josejx@gentoo.org> eselect-1.2.9.ebuild:
+  Marked ppc stable for bug #302878.
+
+  06 Feb 2010; Raúl Porcel <armin76@gentoo.org> eselect-1.2.9.ebuild:
+  alpha/ia64/m68k/s390/sh/sparc stable wrt #302878
+
+*eselect-1.2.10 (05 Feb 2010)
+
+  05 Feb 2010; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.3.ebuild,
+  +eselect-1.2.10.ebuild:
+  Version bump. Remove old.
+
+  04 Feb 2010; Markus Meier <maekke@gentoo.org> eselect-1.2.9.ebuild:
+  amd64/arm stable, bug #302878
+
+  02 Feb 2010; Jeroen Roovers <jer@gentoo.org> eselect-1.2.9.ebuild:
+  Stable for HPPA (bug #302878).
+
+  01 Feb 2010; Tiago Cunha <tcunha@gentoo.org> eselect-1.2.9.ebuild:
+  stable sparc, bug 302878
+
+  01 Feb 2010; Christian Faulhammer <fauli@gentoo.org> eselect-1.2.9.ebuild:
+  stable x86, bug 302878
+
+  01 Feb 2010; Brent Baude <ranger@gentoo.org> eselect-1.2.9.ebuild:
+  stable ppc64, bug 302878
+
+  11 Jan 2010; Raúl Porcel <armin76@gentoo.org> eselect-1.2.8.ebuild:
+  alpha/arm/ia64/m68k/s390/sh stable wrt #297496
+
+  31 Dec 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.2.9.ebuild:
+  Inherit bash-completion.eclass, bug 299051.
+
+  31 Dec 2009; Brent Baude <ranger@gentoo.org> eselect-1.2.8.ebuild:
+  Marking eselect-1.2.8 ppc64 for bug 297496
+
+*eselect-1.2.9 (31 Dec 2009)
+
+  31 Dec 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.7.ebuild,
+  +eselect-1.2.9.ebuild:
+  Version bump, fixes bugs 298742 and 298789. Remove old.
+
+  29 Dec 2009; Christian Faulhammer <fauli@gentoo.org> eselect-1.2.8.ebuild:
+  stable x86, bug 297496
+
+  29 Dec 2009; Samuli Suominen <ssuominen@gentoo.org> eselect-1.2.8.ebuild:
+  amd64 stable wrt #297496
+
+  28 Dec 2009; nixnut <nixnut@gentoo.org> eselect-1.2.8.ebuild:
+  ppc stable #297496
+
+  28 Dec 2009; Tiago Cunha <tcunha@gentoo.org> eselect-1.2.8.ebuild:
+  stable sparc, bug 297496
+
+  24 Dec 2009; Jeroen Roovers <jer@gentoo.org> eselect-1.2.8.ebuild:
+  Stable for HPPA (bug #297496).
+
+*eselect-1.2.8 (20 Nov 2009)
+
+  20 Nov 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.5.ebuild,
+  -eselect-1.2.6.ebuild, +eselect-1.2.8.ebuild:
+  Version bump, fixes bug 293317. Remove old.
+
+*eselect-1.2.7 (14 Nov 2009)
+
+  14 Nov 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2.7.ebuild:
+  Version bump, fixes bug 289095.
+
+*eselect-1.2.6 (07 Nov 2009)
+
+  07 Nov 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.1.3.ebuild,
+  -eselect-1.2.4.ebuild, +eselect-1.2.6.ebuild:
+  Version bump. Remove old.
+
+*eselect-1.2.5 (04 Nov 2009)
+
+  04 Nov 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2.5.ebuild:
+  Version bump; fixes bugs 280191 and 288527.
+
+  13 Oct 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.1.3.ebuild,
+  eselect-1.2.3.ebuild, eselect-1.2.4.ebuild:
+  Update dependency after realpath package move, bug 273968.
+
+  11 Oct 2009; Jeroen Roovers <jer@gentoo.org> eselect-1.2.3.ebuild:
+  Stable for HPPA (bug #287135).
+
+  09 Oct 2009; Fabian Groffen <grobian@gentoo.org> eselect-1.2.4.ebuild:
+  Added Prefix keywords and fixed the ebuild for Prefix
+
+*eselect-1.2.4 (09 Oct 2009)
+
+  09 Oct 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.0.12.ebuild,
+  -eselect-1.2.1.ebuild, +eselect-1.2.4.ebuild:
+  Version bump. Remove old.
+
+  08 Oct 2009; Raúl Porcel <armin76@gentoo.org> eselect-1.2.3.ebuild:
+  alpha/arm/ia64/m68k/s390/sh stable wrt #287135
+
+  05 Oct 2009; Tiago Cunha <tcunha@gentoo.org> eselect-1.2.3.ebuild:
+  stable sparc, bug 287135
+
+  03 Oct 2009; Christian Faulhammer <fauli@gentoo.org> eselect-1.2.3.ebuild:
+  stable x86, bug 287135
+
+  03 Oct 2009; Brent Baude <ranger@gentoo.org> eselect-1.2.3.ebuild:
+  Marking eselect-1.2.3 ppc64 for bug 287135
+
+  03 Oct 2009; Mounir Lamouri <volkmar@gentoo.org> eselect-1.2.3.ebuild:
+  Stable for ppc, bug 287135
+
+  01 Oct 2009; Dawid Węgliński <cla@gentoo.org> eselect-1.2.3.ebuild:
+  Stable on amd64 (bug #287135)
+
+*eselect-1.2.3 (20 Sep 2009)
+
+  20 Sep 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.2.2.ebuild,
+  +eselect-1.2.3.ebuild:
+  Version bump, fixes bug 285762. Remove intermediate version.
+
+*eselect-1.2.2 (19 Sep 2009)
+
+  19 Sep 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2.2.ebuild:
+  Version bump.
+
+  15 Sep 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.1.1.ebuild,
+  -eselect-1.2.ebuild:
+  Remove old.
+
+  15 Sep 2009; Jeroen Roovers <jer@gentoo.org> eselect-1.1.3.ebuild:
+  Stable for HPPA (bug #283079).
+
+  11 Sep 2009; Raúl Porcel <armin76@gentoo.org> eselect-1.1.3.ebuild:
+  arm/ia64/m68k/s390/sh/sparc stable wrt #283079
+
+*eselect-1.2.1 (09 Sep 2009)
+
+  09 Sep 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2.1.ebuild:
+  Version bump, fixes bug 283932.
+
+  07 Sep 2009; Markus Meier <maekke@gentoo.org> eselect-1.1.3.ebuild:
+  amd64/x86 stable, bug #283079
+
+  31 Aug 2009; Brent Baude <ranger@gentoo.org> eselect-1.1.3.ebuild:
+  Marking eselect-1.1.3 ppc64 for bug 283079
+
+  31 Aug 2009; Brent Baude <ranger@gentoo.org> eselect-1.1.1.ebuild:
+  Marking eselect-1.1.1 ppc64 for bug 277187
+
+  30 Aug 2009; Tobias Klausmann <klausman@gentoo.org> eselect-1.1.3.ebuild:
+  Stable on alpha, bug #283079
+
+  30 Aug 2009; nixnut <nixnut@gentoo.org> eselect-1.1.3.ebuild:
+  ppc stable #283079
+
+*eselect-1.2 (27 Aug 2009)
+
+  27 Aug 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.1.2.ebuild,
+  -eselect-1.2_rc1.ebuild, +eselect-1.2.ebuild:
+  Version bump. Remove intermediate versions.
+
+*eselect-1.2_rc1 (19 Aug 2009)
+
+  19 Aug 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.2_rc1.ebuild:
+  Version bump; fixes bug 280598; enhancements from bugs 154511 and 274760.
+
+*eselect-1.1.3 (16 Aug 2009)
+
+  16 Aug 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.0.10.ebuild,
+  -eselect-1.0.11-r1.ebuild,
+  -files/eselect-1.0.11-fix-paludis-command.patch, +eselect-1.1.3.ebuild:
+  Version bump, fixes bug 279662. Remove old.
+
+  21 Jul 2009; <chainsaw@gentoo.org> eselect-1.1.1.ebuild:
+  Marked stable on AMD64 as requested by Ulrich Müller <ulm@gentoo.org> in
+  bug #277187. Tested with the profile module.
+
+  17 Jul 2009; Raúl Porcel <armin76@gentoo.org> eselect-1.1.1.ebuild:
+  alpha/arm/ia64/m68k/s390/sh stable wrt #277187
+
+  16 Jul 2009; nixnut <nixnut@gentoo.org> eselect-1.1.1.ebuild:
+  ppc stable #277187
+
+  09 Jul 2009; Jeroen Roovers <jer@gentoo.org> eselect-1.1.1.ebuild:
+  Stable for HPPA (bug #277187).
+
+  09 Jul 2009; Christian Faulhammer <fauli@gentoo.org> eselect-1.1.1.ebuild:
+  stable x86, bug 277187
+
+  09 Jul 2009; Ferris McCormick <fmccor@gentoo.org> eselect-1.1.1.ebuild:
+  Sparc stable, Bug #277187.
+
+  28 Jun 2009; Brent Baude <ranger@gentoo.org> eselect-1.0.12.ebuild:
+  Marking eselect-1.0.12 ppc64 for bug 270138
+
+*eselect-1.1.2 (27 Jun 2009)
+
+  27 Jun 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.1.2.ebuild:
+  Version bump.
+
+  12 Jun 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.0.11-r2.ebuild,
+  -files/eselect-1.0.11-parent-profiles.patch,
+  -files/eselect-1.0.11-relative-profiles.patch, -eselect-1.1.ebuild,
+  metadata.xml:
+  Remove intermediate versions.
+
+*eselect-1.1.1 (06 Jun 2009)
+
+  06 Jun 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.1.1.ebuild:
+  Version bump. Remove paludis USE flag since it doesn't make much sense
+  without the corresponding dependency; use app-admin/eselect-package-manager
+  for selection of a package manager instead.
+
+  02 Jun 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.1.ebuild,
+  -eselect-1.1_rc2.ebuild, -eselect-1.1_rc3.ebuild:
+  Don't depend on paludis, in order to avoid a circular dependency; thanks
+  to Ingmar Vanhassel for pointing this out. Print a warning message in
+  pkg_postinst instead. Remove release candidates.
+
+*eselect-1.1 (27 May 2009)
+
+  27 May 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.1.ebuild,
+  -eselect-9999.ebuild:
+  Version bump. Remove live ebuild.
+
+  24 May 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.0.10.ebuild,
+  eselect-1.0.11-r1.ebuild, eselect-1.0.11-r2.ebuild, eselect-1.0.12.ebuild,
+  eselect-1.1_rc2.ebuild, eselect-1.1_rc3.ebuild, eselect-9999.ebuild:
+  Fix dependencies: readlink/realpath are also needed at run time.
+
+  24 May 2009; Markus Meier <maekke@gentoo.org> eselect-1.0.12.ebuild:
+  amd64 stable, bug #270138
+
+  21 May 2009; Brent Baude <ranger@gentoo.org> eselect-1.0.12.ebuild:
+  stable ppc, bug 270138
+
+  21 May 2009; Raúl Porcel <armin76@gentoo.org> eselect-1.0.12.ebuild:
+  arm/ia64/m68k/s390/sh/sparc stable wrt #270138
+
+*eselect-1.1_rc3 (21 May 2009)
+
+  21 May 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.1_rc3.ebuild:
+  Version bump.
+
+  20 May 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.1_rc2.ebuild,
+  eselect-9999.ebuild:
+  Create directory for news-tng module. Set proper group and permissions.
+
+*eselect-1.1_rc2 (19 May 2009)
+
+  19 May 2009; Ulrich Mueller <ulm@gentoo.org> -eselect-1.1_rc1.ebuild,
+  +eselect-1.1_rc2.ebuild:
+  Version bump, fixes bug 270406. Remove previous release candidate.
+
+*eselect-1.1_rc1 (18 May 2009)
+
+  18 May 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.1_rc1.ebuild:
+  Version bump; fixes bugs 155814 and 156866; enhancements from bugs 148578,
+  153890, 180966, 190216, and 220473.
+
+  18 May 2009; Christian Faulhammer <fauli@gentoo.org>
+  eselect-1.0.12.ebuild:
+  stable x86, bug 270138
+
+  18 May 2009; Jeroen Roovers <jer@gentoo.org> eselect-1.0.12.ebuild:
+  Stable for HPPA (bug #270138).
+
+  17 May 2009; Tobias Klausmann <klausman@gentoo.org> eselect-1.0.12.ebuild:
+  Stable on alpha, bug #270138
+
+  28 Apr 2009; Ulrich Mueller <ulm@gentoo.org> metadata.xml, eselect-9999:
+  Add paludis USE flag for the live ebuild.
+
+*eselect-9999 (18 Apr 2009)
+*eselect-1.0.12 (18 Apr 2009)
+
+  18 Apr 2009; Ulrich Mueller <ulm@gentoo.org> +eselect-1.0.12.ebuild,
+  +eselect-9999.ebuild:
+  Version bump to 1.0.12; fixes bugs 172636, 198461, 203114, 204937, 218557,
+  219864, 232874, 240402, 248470, 248487, 260464, and 264734. Add live ebuild
+  for SVN trunk. Remove dependencies on editor modes, since only few users of
+  eselect will edit its source.
+
+  17 Apr 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.0.11-r1.ebuild,
+  eselect-1.0.11-r2.ebuild:
+  Clarify the elog message in pkg_postinst, bug 187263. Remove the dependency
+  on procps (added at 14 April) again, since it leads to problems on FreeBSD;
+  bug 266540. In fact, a working "pgrep" command is not essential, since it is
+  only called from the "die" function. See bug 264734 for details.
+
+  15 Apr 2009; Ulrich Mueller <ulm@gentoo.org>
+  -files/eselect-1.0.8-fix-parallel-install.patch:
+  Remove stale file.
+
+  14 Apr 2009; Ulrich Mueller <ulm@gentoo.org> eselect-1.0.11-r2.ebuild:
+  Add procps to RDEPEND, fixes bug 174354.
+
+  08 Apr 2009; Jeremy Olexa <darkside@gentoo.org>
+  +files/eselect-1.0.11-relative-profiles.patch, eselect-1.0.11-r2.ebuild:
+  Make 'eselect profile show' show the relative path. Patch by Thomas Bellman
+  in bug 248487
+
+*eselect-1.0.11-r2 (08 Apr 2009)
+
+  08 Apr 2009; Jeremy Olexa <darkside@gentoo.org>
+  +files/eselect-1.0.11-parent-profiles.patch, -eselect-1.0.2.ebuild,
+  -eselect-1.0.7.ebuild, -eselect-1.0.8.ebuild, -eselect-1.0.9.ebuild,
+  -eselect-1.0.11.ebuild, +eselect-1.0.11-r2.ebuild:
+  Version bump to fix bug 248470, patch by Thomas Bellman. Allows parent
+  profiles to be selectable. Also, remove old versions
+
+  08 Apr 2009; Jeremy Olexa <darkside@gentoo.org> eselect-1.0.11-r1.ebuild:
+  fix postinst message to include instructions for enabling globally, bug 265168
+
+  17 Mar 2009; Raúl Porcel <armin76@gentoo.org> eselect-1.0.11-r1.ebuild:
+  m68k stable wrt #208898, thanks to kolla for testing
+
+  29 Dec 2008; Raúl Porcel <armin76@gentoo.org> eselect-1.0.11-r1.ebuild:
+  s390/sh stable wrt #208898
+
+  16 Dec 2008; Doug Goldstein <cardoe@gentoo.org> eselect-1.0.11-r1.ebuild:
+  amd64 stable
+
+  10 Dec 2008; Jeroen Roovers <jer@gentoo.org> eselect-1.0.11-r1.ebuild:
+  Stable for HPPA (bug #208898).
+
+  09 Dec 2008; Brent Baude <ranger@gentoo.org> eselect-1.0.11-r1.ebuild:
+  Marking eselect-1.0.11-r1 ppc64 and ppc for bug 208898
+
+  08 Dec 2008; Raúl Porcel <armin76@gentoo.org> eselect-1.0.11-r1.ebuild:
+  alpha/arm/ia64/sparc/x86 stable wrt #208898
+
+  25 May 2008; Markus Rothe <corsair@gentoo.org> eselect-1.0.11-r1.ebuild:
+  Stable on ppc64
+
+*eselect-1.0.11-r1 (20 Mar 2008)
+
+  20 Mar 2008; Piotr Jaroszyński <peper@gentoo.org>
+  +files/eselect-1.0.11-fix-paludis-command.patch,
+  +eselect-1.0.11-r1.ebuild:
+  Add -r1 with a patch fixing paludis_command().
+
+*eselect-1.0.11 (01 Dec 2007)
+
+  01 Dec 2007; Piotr Jaroszyński <peper@gentoo.org> +eselect-1.0.11.ebuild:
+  Add 1.0.11.
+
+  05 Aug 2007; nixnut <nixnut@gentoo.org> eselect-1.0.10.ebuild:
+  Stable on ppc wrt bug 185691
+
+  01 Aug 2007; Joshua Kinard <kumba@gentoo.org> eselect-1.0.10.ebuild:
+  Stable on mips, per #185691.
+
+  01 Aug 2007; <metalgod@gentoo.org> eselect-1.0.10.ebuild:
+  Stable on amd64. See bug #185691.
+
+  30 Jul 2007; Raúl Porcel <armin76@gentoo.org> eselect-1.0.10.ebuild:
+  alpha/ia64 stable wrt #185691
+
+  30 Jul 2007; Jeroen Roovers <jer@gentoo.org> eselect-1.0.10.ebuild:
+  Stable for HPPA (bug #185691).
+
+  30 Jul 2007; Gustavo Zacarias <gustavoz@gentoo.org> eselect-1.0.10.ebuild:
+  Stable on sparc wrt #185691
+
+  30 Jul 2007; Markus Rothe <corsair@gentoo.org> eselect-1.0.10.ebuild:
+  Stable on ppc64; bug #185691
+
+  30 Jul 2007; Christian Faulhammer <opfer@gentoo.org>
+  eselect-1.0.10.ebuild:
+  stable x86, bug 185691
+
+*eselect-1.0.10 (17 Jun 2007)
+
+  17 Jun 2007; Danny van Dyk <kugelfang@gentoo.org> +eselect-1.0.10.ebuild:
+  Released 1.0.10 that fixes bugs #172472 and #172475. Thanks to Ulrich
+  Mueller <ulm@gentoo.org>.
+
+  06 May 2007; Mike Kelly <pioto@gentoo.org> eselect-1.0.9.ebuild:
+  Add vim-syntax USE flag to pull in eselect-syntax.
+
+*eselect-1.0.9 (28 Mar 2007)
+
+  28 Mar 2007; <pioto@gentoo.org> +eselect-1.0.9.ebuild:
+  Version bump. Fixes parallel install, improper use of DISTDIR, and some
+  issues with env.eselect.
+
+  07 Feb 2007; Simon Stelling <blubb@gentoo.org> eselect-1.0.7.ebuild:
+  stable on amd64; bug 160535
+
+  26 Jan 2007; Bryan Østergaard <kloeri@gentoo.org> eselect-1.0.7.ebuild:
+  Stable on Alpha.
+
+  25 Jan 2007; Alexander H. Færøy <eroyf@gentoo.org> eselect-1.0.7.ebuild:
+  Stable on MIPS.
+
+  24 Jan 2007; Marius Mauch <genone@gentoo.org> eselect-1.0.2.ebuild,
+  eselect-1.0.7.ebuild, eselect-1.0.8.ebuild:
+  Replacing einfo with elog
+
+  16 Jan 2007; Jeroen Roovers <jer@gentoo.org> eselect-1.0.7.ebuild:
+  Stable for HPPA (bug #160535).
+
+  15 Jan 2007; Mike Kelly <pioto@gentoo.org>
+  +files/eselect-1.0.8-fix-parallel-install.patch, eselect-1.0.8.ebuild:
+  Add a patch to really really fix Bug #162008.
+
+  14 Jan 2007; Danny van Dyk <kugelfang@gentoo.org> eselect-1.0.7.ebuild:
+  Marked stable on amd64.
+
+*eselect-1.0.8 (14 Jan 2007)
+
+  14 Jan 2007; Mike Kelly <pioto@gentoo.org> +eselect-1.0.8.ebuild:
+  Version bump. Really fixes Bug #162008.
+
+  14 Jan 2007; Mike Kelly <pioto@gentoo.org> eselect-1.0.7.ebuild:
+  Force non-parallel install for now until all the Makefile issues can be fixed.
+
+  14 Jan 2007; Joseph Jezak <josejx@gentoo.org> eselect-1.0.7.ebuild:
+  Marked ppc stable for bug #160535.
+
+  09 Jan 2007; Christian Faulhammer <opfer@gentoo.org> eselect-1.0.7.ebuild:
+  stable x86, bug #160535
+
+  09 Jan 2007; Markus Rothe <corsair@gentoo.org> eselect-1.0.7.ebuild:
+  Stable on ppc64; bug #160535
+
+  08 Jan 2007; Gustavo Zacarias <gustavoz@gentoo.org> eselect-1.0.7.ebuild:
+  Stable on sparc wrt #160535
+
+  07 Jan 2007; Mike Kelly <pioto@gentoo.org> eselect-1.0.7.ebuild:
+  Mark ~amd64 again, since we need to stable a few other things first. See Bug
+  #160535.
+
+  06 Jan 2007; Mike Kelly <pioto@gentoo.org> eselect-1.0.7.ebuild:
+  Mark stable on amd64 (okayed by Kugelfang).
+
+  06 Jan 2007; Mike Kelly <pioto@gentoo.org> -eselect-1.0.6.ebuild:
+  Remove old and kinda buggy 1.0.6 version.
+
+  09 Nov 2006; Marien Zwart <marienz@gentoo.org> Manifest:
+  Fix Manifest.
+
+  09 Nov 2006; Marien Zwart <marienz@gentoo.org> +eselect-1.0.6.ebuild:
+  Put 1.0.6 back to avoid a downgrade while 1.0.7 is masked.
+
+*eselect-1.0.7 (08 Nov 2006)
+
+  08 Nov 2006; Danny van Dyk <kugelfang@gentoo.org> -eselect-1.0.ebuild,
+  -eselect-1.0.6.ebuild, +eselect-1.0.7.ebuild:
+  Removed obsolete version 1.0. Bumped eselect to version 1.0.7, which is a
+  bugfix release.
+
+  18 Oct 2006; Roy Marples <uberlord@gentoo.org> eselect-1.0.6.ebuild:
+  Added ~sparc-fbsd keyword.
+
+*eselect-1.0.6 (03 Oct 2006)
+
+  03 Oct 2006; Danny van Dyk <kugelfang@gentoo.org> -eselect-1.0.5.ebuild,
+  +eselect-1.0.6.ebuild:
+  Removed version 1.0.5. Added version 1.0.6.
+
+  04 Sep 2006; Joshua Kinard <kumba@gentoo.org> eselect-1.0.2.ebuild:
+  Marked stable on mips.
+
+*eselect-1.0.5 (26 Aug 2006)
+
+  26 Aug 2006; Danny van Dyk <kugelfang@gentoo.org> -eselect-1.0.4.ebuild,
+  +eselect-1.0.5.ebuild:
+  Removed version 1.0.4. Added version 1.0.5.
+
+  19 Aug 2006; Bryan Østergaard <kloeri@gentoo.org> eselect-1.0.2.ebuild:
+  Stable on alpha.
+
+  16 Aug 2006; Markus Rothe <corsair@gentoo.org> eselect-1.0.2.ebuild:
+  Stable on ppc64
+
+*eselect-1.0.4 (02 Aug 2006)
+
+  02 Aug 2006; Danny van Dyk <kugelfang@gentoo.org> -eselect-1.0.3.ebuild,
+  +eselect-1.0.4.ebuild:
+  Removed release 1.0.3. Added release 1.0.4.
+
+  02 Aug 2006; Gustavo Zacarias <gustavoz@gentoo.org> eselect-1.0.2.ebuild:
+  Stable on hppa
+
+  29 Jul 2006; Fabian Groffen <grobian@gentoo.org> eselect-1.0.2.ebuild:
+  Marked ~ppc-macos
+
+  15 Jul 2006; Joshua Jackson <tsunam@gentoo.org> eselect-1.0.2.ebuild:
+  Stable x86; openoffice security bug
+
+  15 Jul 2006; Luis Medinas <metalgod@gentoo.org> eselect-1.0.2.ebuild:
+  Stable on amd64.
+
+  12 Jul 2006; Aron Griffis <agriffis@gentoo.org> eselect-1.0.2.ebuild:
+  Mark 1.0.2 stable on ia64
+
+  12 Jul 2006; Gustavo Zacarias <gustavoz@gentoo.org> eselect-1.0.2.ebuild:
+  Stable on sparc
+
+  06 Jul 2006; Danny van Dyk <kugelfang@gentoo.org> eselect-1.0.ebuild,
+  eselect-1.0.2.ebuild, eselect-1.0.3.ebuild:
+  Added ChangeLog to the list of to-be-installed documents.
+
+  05 Jul 2006; Lars Weiler <pylon@gentoo.org> eselect-1.0.2.ebuild:
+  Stable on ppc; dependency for bug #139249.
+
+  03 Jul 2006; <malc@gentoo.org> files/digest-eselect-1.0,
+  files/digest-eselect-1.0.2, Manifest:
+  Fix broken digests - as reported in #gentoo-amd64
+
+*eselect-1.0.3 (03 Jul 2006)
+
+  06 Jun 2006; Stephen Bennett <spb@gentoo.org> eselect-1.0.ebuild:
+  Mips stable for bug #125630
+
+  19 Apr 2006; Diego Pettenò <flameeyes@gentoo.org> eselect-1.0.2.ebuild:
+  Add dependency over freebsd-bin as alternative to realpath, it does already
+  provide a realpath binary that works.
+
+*eselect-1.0.2 (14 Apr 2006)
+
+  14 Apr 2006; Danny van Dyk <kugelfang@gentoo.org> -eselect-1.0.1.ebuild,
+  +eselect-1.0.2.ebuild:
+  Added bugfix release 1.0.2. Removed 1.0.1 due to a slightly broken env.eselect.
+
+*eselect-1.0.1 (02 Apr 2006)
+
+  02 Apr 2006; Danny van Dyk <kugelfang@gentoo.org> -eselect-0.9.6.ebuild,
+  -eselect-1.0_rc1.ebuild, -eselect-1.0_rc2.ebuild, eselect-1.0.ebuild,
+  +eselect-1.0.1.ebuild:
+  Removed obsolete versions. Updated RDEPEND with sys-apps/file. Added 1.0.1
+  release.
+
+  30 Mar 2006; Diego Pettenò <flameeyes@gentoo.org> eselect-1.0.ebuild:
+  Add ~x86-fbsd keyword, although the env module doesn't work, as other
+  modules are needed for other packages; most of this version works fine.
+
+  12 Mar 2006; Jason Wever <weeve@gentoo.org> eselect-1.0.ebuild:
+  Stable on SPARC wrt bug #125630.
+
+  10 Mar 2006; Fernando J. Pereda <ferdy@gentoo.org> eselect-1.0.ebuild:
+  Stable on alpha wrt bug #125630
+
+  10 Mar 2006; Markus Rothe <corsair@gentoo.org> eselect-1.0.ebuild:
+  Stable on ppc64; bug #125630
+
+  10 Mar 2006; Lars Weiler <pylon@gentoo.org> eselect-1.0.ebuild:
+  Stable on ppc wrt bug #125630.
+
+  10 Mar 2006; Michele Noberasco <s4t4n@gentoo.org> eselect-1.0.ebuild:
+  Stable for x86. See bug #125630.
+
+  09 Mar 2006; Aron Griffis <agriffis@gentoo.org> eselect-1.0.ebuild:
+  Mark 1.0 stable on ia64
+
+  09 Mar 2006; Jeroen Roovers <jer@gentoo.org> eselect-1.0.ebuild:
+  Stable on hppa (bug #125630).
+
+  09 Mar 2006; Danny van Dyk <kugelfang@gentoo.org> eselect-1.0.ebuild:
+  Marked stable on amd64.
+
+*eselect-1.0 (09 Feb 2006)
+
+  09 Feb 2006; Ciaran McCreesh <ciaranm@gentoo.org> +eselect-1.0.ebuild:
+  New release.
+
+  19 Nov 2005; Markus Rothe <corsair@gentoo.org> eselect-0.9.6.ebuild,
+  eselect-1.0_rc1.ebuild, eselect-1.0_rc2.ebuild:
+  Added ~ppc64; bug #102649
+
+*eselect-1.0_rc2 (16 Nov 2005)
+
+  16 Nov 2005; Danny van Dyk <kugelfang@gentoo.org> +eselect-1.0_rc2.ebuild:
+  Second release candidate for eselect-1.0. Fixes some bugs in BLAS and LAPACK
+  support. Adds support for MKL72.
+
+*eselect-1.0_rc1 (19 Oct 2005)
+
+  19 Oct 2005; Aaron Walker <ka0ttic@gentoo.org> +eselect-1.0_rc1.ebuild:
+  First release candidate for 1.0. Please test; the more testers we get, the
+  faster we'll get a stable eselect. This release fixes bugs #101898,#104354,
+  and #106540 as well as a sleu of others (see NEWS for a full list).
+
+  19 Sep 2005; Aaron Walker <ka0ttic@gentoo.org> -eselect-0.9.5.ebuild:
+  0.9.5 has a broken digest; not worth keeping around, so removing it.
+
+  01 Aug 2005; Aaron Walker <ka0ttic@gentoo.org> eselect-0.9.5.ebuild,
+  eselect-0.9.6.ebuild:
+  Since I'm an idiot, use newins rather than doins for installing the bashcomp.
+
+  31 Jul 2005; Aaron Walker <ka0ttic@gentoo.org> eselect-0.9.5.ebuild,
+  eselect-0.9.6.ebuild:
+  Added ~hppa; updated ebuilds to not use bash-completion.eclass; also added
+  missing NEWS/AUTHORS to the list of dodoc'd files.
+
+*eselect-0.9.6 (25 Jul 2005)
+
+  25 Jul 2005; Danny van Dyk <kugelfang@gentoo.org> +eselect-0.9.6.ebuild:
+  Version bump.
+
+*eselect-0.9.5 (18 Jun 2005)
+
+  18 Jun 2005; Aaron Walker <ka0ttic@gentoo.org> -eselect-0.9.4.ebuild,
+  +eselect-0.9.5.ebuild:
+  Version bump.
+
+*eselect-0.9.4 (13 Jun 2005)
+
+  13 Jun 2005; Aaron Walker <ka0ttic@gentoo.org> +metadata.xml,
+  +eselect-0.9.4.ebuild:
+  Version bump; moved from app-admin/eclectic to app-admin/eselect.
+
+  04 Jun 2005; Stephen Bennett <spb@gentoo.org> eclectic-0.9.3.ebuild:
+  ~mips keywords
+
+  17 May 2005; Ciaran McCreesh <ciaranm@gentoo.org> eclectic-0.9.2.ebuild,
+  eclectic-0.9.3.ebuild:
+  Update homepage now that there's a proper website
+
+  16 May 2005; Ciaran McCreesh <ciaranm@gentoo.org> eclectic-0.9.3.ebuild:
+  Up the bash dependency to version 3. This is temporary and just for this
+  release.
+
+*eclectic-0.9.3 (16 May 2005)
+
+  16 May 2005; Ciaran McCreesh <ciaranm@gentoo.org> +eclectic-0.9.3.ebuild:
+  Version bump
+
+  15 May 2005; Fernando J. Pereda <ferdy@gentoo.org> eclectic-0.9.2.ebuild:
+  keyworded ~alpha
+
+  15 May 2005; Ciaran McCreesh <ciaranm@gentoo.org> metadata.xml,
+  eclectic-0.9.2.ebuild:
+  Added ~sparc, update metadata
+
+  12 May 2005; Danny van Dyk <kugelfang@gentoo.org> eclectic-0.9.2.ebuild:
+  Marked ~amd64.
+
+  12 May 2005; Aaron Walker <ka0ttic@gentoo.org> eclectic-0.9.2.ebuild:
+  Fix dohtml glob; default.css wasn't getting installed.
+
+  11 May 2005; Lars Weiler <pylon@gentoo.org> eclectic-0.9.2.ebuild:
+  Added ~ppc.
+
+*eclectic-0.9.2 (08 May 2005)
+
+  08 May 2005; Aaron Walker <ka0ttic@gentoo.org> -eclectic-0.9.1.ebuild,
+  +eclectic-0.9.2.ebuild:
+  Version bump.
+
+*eclectic-0.9.1 (08 May 2005)
+
+  08 May 2005; Aaron Walker <ka0ttic@gentoo.org> +metadata.xml,
+  +eclectic-0.9.1.ebuild:
+  Initial commit.
+

diff --git a/app-admin/eselect/eselect-1.2.16-r1.ebuild b/app-admin/eselect/eselect-1.2.16-r1.ebuild
new file mode 100644
index 0000000..d8a2ea5
--- /dev/null
+++ b/app-admin/eselect/eselect-1.2.16-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=3
+inherit eutils bash-completion autotools
+
+DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
+HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc"
+
+RDEPEND="sys-apps/sed
+	|| (
+		sys-apps/coreutils
+		sys-freebsd/freebsd-bin
+		app-misc/realpath
+	)"
+DEPEND="${RDEPEND}
+	doc? ( dev-python/docutils )"
+RDEPEND="!app-admin/eselect-news
+	${RDEPEND}
+	sys-apps/file
+	sys-libs/ncurses"
+
+# Commented out: only few users of eselect will edit its source
+#PDEPEND="emacs? ( app-emacs/gentoo-syntax )
+#	vim-syntax? ( app-vim/eselect-syntax )"
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-alternatives.patch
+	eautoreconf
+}
+
+src_compile() {
+	emake || die "emake failed"
+
+	if use doc; then
+		make html || die "failed to build html"
+	fi
+}
+
+src_install() {
+	emake DESTDIR="${D}" install || die "make install failed"
+	dodoc AUTHORS ChangeLog NEWS README TODO doc/*.txt
+	use doc && dohtml *.html doc/*
+	dobashcompletion misc/${PN}.bashcomp
+
+	# needed by news module
+	keepdir /var/lib/gentoo/news
+}
+
+pkg_postinst() {
+	# fowners in src_install doesn't work for the portage group:
+	# merging changes the group back to root
+	[[ -z ${EROOT} ]] && local EROOT=${ROOT}
+	chgrp portage "${EROOT}/var/lib/gentoo/news" \
+		&& chmod g+w "${EROOT}/var/lib/gentoo/news"
+
+	bash-completion_pkg_postinst
+}

diff --git a/app-admin/eselect/files/eselect-alternatives.patch b/app-admin/eselect/files/eselect-alternatives.patch
new file mode 100644
index 0000000..9914980
--- /dev/null
+++ b/app-admin/eselect/files/eselect-alternatives.patch
@@ -0,0 +1,601 @@
+Index: libs/Makefile.am
+===================================================================
+--- libs/Makefile.am	(revision 803)
++++ libs/Makefile.am	(working copy)
+@@ -1,6 +1,7 @@
+ eselectlibsdir = $(datadir)/$(PACKAGE_NAME)/libs/
+ 
+ eselectlibs_DATA = \
++		   alternatives.bash \
+ 		   config.bash \
+ 		   core.bash \
+ 		   default.eselect \
+@@ -14,6 +15,7 @@
+ 		   tests.bash
+ 
+ EXTRA_DIST = \
++	     alternatives.bash.in \
+ 	     config.bash.in \
+ 	     core.bash.in \
+ 	     default.eselect.in \
+@@ -30,7 +32,8 @@
+ 	-e 's,\@SED\@,@SED@,g' \
+ 	-e 's,\@PORTAGEQ\@,@PORTAGEQ@,g' \
+ 	-e 's,\@ENV_UPDATE\@,@ENV_UPDATE@,g' \
+-	-e 's,\@CANONICALISE\@,@CANONICALISE@,g'
++	-e 's,\@CANONICALISE\@,@CANONICALISE@,g' \
++	-e 's,\@sysconfdir\@,@sysconfdir@,g'
+ 
+ %.bash : %.bash.in
+ 	@$(dosed) $< > $@
+Index: bin/Makefile.am
+===================================================================
+--- bin/Makefile.am	(revision 803)
++++ bin/Makefile.am	(working copy)
+@@ -4,6 +4,7 @@
+ dosed = @SED@ -e 's,\@BASH\@,$(BASH),g' \
+ 	      -e 's,\@DATADIR\@,$(datadir),g' \
+ 	      -e 's,\@EPREFIX\@,$(EPREFIX),g' \
++	      -e 's,\@LIBEXECDIR\@,$(datadir),g' \
+ 	      -e 's,\@VERSION\@,$(VERSION),g'
+ 
+ % : %.in
+Index: bin/eselect.in
+===================================================================
+--- bin/eselect.in	(revision 803)
++++ bin/eselect.in	(working copy)
+@@ -22,10 +22,15 @@
+ # Where are modules installed by default?
+ ESELECT_DEFAULT_MODULES_PATH="${ESELECT_DATA_PATH}/modules"
+ 
++# Where are auto-generated modules placed? (e.g. from alternatives-2.eclas)
++ESELECT_AUTO_GENERATED_MODULES_PATH="${ESELECT_DEFAULT_MODULES_PATH}/auto"
++
+ # Look in these places for modules
+-ESELECT_MODULES_PATH=( \
+-	"${HOME}/.eselect/modules" \
+-	"${ESELECT_DEFAULT_MODULES_PATH}" )
++ESELECT_MODULES_PATH=(
++	"${HOME}/.eselect/modules"
++	"${ESELECT_DEFAULT_MODULES_PATH}"
++	"${ESELECT_AUTO_GENERATED_MODULES_PATH}"
++)
+ 
+ # Look in this place for libraries
+ ESELECT_CORE_PATH="${ESELECT_DATA_PATH}/libs"
+--- libs/alternatives.bash.in.orig	1970-01-01 01:00:00.000000000 +0100
++++ libs/alternatives.bash.in	2010-12-15 19:37:54.000000000 +0000
+@@ -0,0 +1,533 @@
++# Copyright 2008 Mike Kelly
++# Copyright 2009 David Leverton
++# Copyright 2010 Bo Ørsted Andresen
++# 2010: Adapted to eselect Sebastien Fabbro (who doesn't like copyrights)
++# Distributed under the terms of the GNU General Public License v2
++
++inherit config output path-manipulation
++
++ALTERNATIVESDIR_ROOTLESS="@sysconfdir@/env.d/alternatives"
++ALTERNATIVESDIR="${EROOT}${ALTERNATIVESDIR_ROOTLESS}"
++
++get_current_provider() {
++    local dieprefix="Could not determine current provider for ${ALTERNATIVE}"
++    if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++        local provider=$(readlink "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: readlink ${symlink} failed")
++        [[ ${provider} == */* ]] && die "${dieprefix}: malformed target for ${symlink}"
++
++        if [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ||
++                    ( -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} && ! -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ) ]]; then
++            die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} is not a directory"
++        fi
++
++        echo "${provider}"
++
++    elif [[ -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current ]]; then
++        die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current is not a symlink"
++    fi
++}
++
++compare_importance() {
++    local IFS=.
++    local a=( ${1} ) b=( ${2} )
++    local -i i=0
++    while (( i<${#a[@]} && i<${#b[@]} )); do
++        if (( a[i]<b[i] )); then
++            return 0
++        elif (( a[i]>b[i] )); then
++            return 1
++        fi
++        i+=1
++    done
++    (( i<${#b[@]} ))
++}
++
++sort_providers() {
++    local begin=${1:-0}
++    local count=${2:-${#providers[@]}}
++    [[ ${count} -le 1 ]] && return 0
++    sort_providers ${begin} $((count/2))
++    sort_providers $((begin+count/2)) $((count-count/2))
++    local left=( "${providers[@]:begin:count/2}" )
++    local right=( "${providers[@]:begin+count/2:count-count/2}" )
++    local -i x i=0 j=0
++    for (( x=begin; x<begin+count; ++x )); do
++        if (( j>=${#right[@]} )) || { (( i<${#left[@]} )) && compare_importance "${left[i]%%:*}" "${right[j]%%:*}"; }; then
++            providers[x]=${left[i++]}
++        else
++            providers[x]=${right[j++]}
++        fi
++    done
++}
++
++get_providers() {
++    local p= importance providers=()
++    for p in "${ALTERNATIVESDIR}/${ALTERNATIVE}"/* ; do
++        [[ -d ${p} && ! -L ${p} ]] || continue
++        p=${p##*/}
++
++        importance=$(< "${ALTERNATIVESDIR}/${ALTERNATIVE}/${p}/_importance")
++        importance=${importance:-0}
++        [[ "${importance}" =~ ^[0123456789]+(\.[0123456789]+)*$ ]] || die "_importance (${importance}) for ${p} is not a dot-separated list of integers"
++
++        providers+=( "${importance}:${p}" )
++    done
++
++    sort_providers
++    for (( p=${#providers[@]}-1 ; p>=0 ; --p )); do
++        echo "${providers[p]#*:}"
++    done
++}
++
++### show action ###
++describe_show() {
++    echo "Show the current provider in use for ${ALTERNATIVE}"
++}
++
++do_show() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local current="$(get_current_provider)"
++    if [[ -z "${current}" ]] ; then
++        echo "(none)"
++        return 2
++    fi
++    echo "${current}"
++}
++
++options_show() {
++    :
++}
++
++### list action ###
++describe_list() {
++    echo "Lists all available providers for ${ALTERNATIVE}"
++}
++
++do_list() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local n cur= providers=( $(get_providers) )
++    write_list_start "Available providers for ${ALTERNATIVE}:"
++
++    cur="$(get_current_provider)"
++
++    if [[ -n "${providers[@]}" ]] ; then
++        for (( n = 0 ; n < ${#providers[@]} ; ++n )) ; do
++            [[ ${cur} ==  "${providers[${n}]}" ]] && \
++                providers[${n}]="${providers[${n}]} $(highlight '*')"
++        done
++        write_numbered_list "${providers[@]}"
++    else
++        write_kv_list_entry "(none found)" ""
++    fi
++}
++
++options_list() {
++    :
++}
++
++### files action ###
++describe_files() {
++    echo "Lists symlinks provided by the currently selected provider"
++}
++
++do_files() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local cur="$(get_current_provider)" p=
++    [[ -n "${cur}" ]] || die -q "No selected provider, hence no symlinks provided"
++    local dieprefix="Could not list symlinks provided for ${ALTERNATIVE}"
++
++    local errors symlink rootsymlink
++    while read -r -d '' symlink; do
++        rootsymlink="${EROOT}${symlink}"
++        rootsymlink=${rootsymlink//+(\/)/\/}
++        echo "${rootsymlink}"
++        if [[ -L ${rootsymlink} ]]; then
++            if [[ ! -e ${rootsymlink} ]]; then
++                write_error_msg "${rootsymlink} is dangling symlink"
++                errors=yes
++            fi
++        elif [[ -d ${rootsymlink} ]]; then
++            write_error_msg "${rootsymlink} is a directory"
++            errors=yes
++        elif [[ -e ${rootsymlink} ]]; then
++            write_error_msg "${rootsymlink} exists but is not a symlink"
++            errors=yes
++        else
++            write_error_msg "${rootsymlink} does not exist"
++            errors=yes
++        fi
++    done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++}
++
++options_files() {
++    :
++}
++
++### set action ###
++
++describe_set() {
++    echo "Sets a provider for ${ALTERNATIVE}"
++}
++
++describe_set_parameters() {
++    echo "[ --force ] <provider>"
++}
++
++describe_set_options() {
++    echo "--force : overwrite or remove existing non-symlink files (but not directories) if necessary"
++    echo "<provider> : the name of the provider to use"
++}
++
++do_set() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local force=
++    if [[ ${1} == --force ]]; then
++        force=yes
++        shift
++    fi
++
++    local provider="${1}"
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++    if is_number "${provider}" ; then
++        local providers=( $(get_providers) )
++        (( ${provider} <= ${#providers[@]} )) || die -q "The given provider (${provider}) does not exist"
++        provider=${providers[${provider}-1]}
++    fi
++    local dieprefix="Could not set provider ${provider} for alternative ${ALTERNATIVE}"
++
++    [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] \
++        || die -q "The given provider (${provider}) does not exist"
++
++    local symlink newsymlinks=() oldsymlinks=()
++
++    while read -r -d '' symlink; do
++        local nicesymlink=${symlink#.}
++        nicesymlink=${nicesymlink//+(\/)/\/}
++        [[ ${nicesymlink} == /* ]] || die "${dieprefix}: bad symlink ${symlink}?"
++        [[ ${nicesymlink} == */ ]] && die "${dieprefix}: bad symlink ${symlink}?"
++
++        newsymlinks+=( "${nicesymlink}" )
++    done < <(
++        cd "${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}" || die "${dieprefix}: cd failed"
++        find . -type l -print0 | LC_ALL=C sort -r -u -z)
++    [[ ${#newsymlinks[@]} -gt 0 ]] || die "${dieprefix}: does not provide any symlinks?"
++
++    if [[ -f ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++        while read -r -d '' symlink; do
++            local nicesymlink=${symlink//+(\/)/\/}
++            [[ ${nicesymlink} == /* ]] || die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++            [[ ${nicesymlink} == */ ]] && die "${dieprefix}: old provider ${oldcur} provides bad symlink ${symlink}?"
++
++            oldsymlinks+=( "${nicesymlink}" )
++        done < <(LC_ALL=C sort -r -u -z "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list")
++        [[ ${#oldsymlinks[@]} -gt 0 ]] || die "${dieprefix}: old provider ${oldcur} does not provide any symlinks?"
++
++    elif [[ -L ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list || -e ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list ]]; then
++        die "${dieprefix}: ${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list is not a file"
++    fi
++
++    local pass errors=
++    for pass in check perform; do
++        local -i new_i=0 old_i=0
++        while [[ -n ${newsymlinks[new_i]} || -n ${oldsymlinks[old_i]} ]]; do
++
++            if ( LC_ALL=C; [[ ${newsymlinks[new_i]} < ${oldsymlinks[old_i]} ]] ); then
++                if [[ ${pass} == check ]]; then
++                    if [[ -L ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        :
++                    elif [[ -d ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        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}"
++                        errors=yes
++                    elif [[ -e ${EROOT}${oldsymlinks[old_i]} ]]; then
++                        if [[ -n ${force} ]]; then
++                            write_warning_msg "Removing ${EROOT}${oldsymlinks[old_i]} due to --force: is not a symlink"
++                        else
++                            write_error_msg "Refusing to remove ${EROOT}${oldsymlinks[old_i]}: is not a symlink (use --force to override)"
++                            errors=yes
++                        fi
++                    fi
++
++                elif [[ ${pass} == perform ]]; then
++                    rm -f "${ROOT}${oldsymlinks[old_i]}" || die "${dieprefix}: rm failed"
++                else
++                    die "${dieprefix}: unknown \${pass} ${pass}???"
++                fi
++
++                old_i+=1
++
++            else
++                local target=${ALTERNATIVESDIR_ROOTLESS#/}/${ALTERNATIVE}/_current${newsymlinks[new_i]} dir=${newsymlinks[new_i]%/*}
++                while [[ -n ${dir} ]]; do
++                    target=../${target}
++                    dir=${dir%/*}
++                done
++
++                if [[ ${pass} == check ]]; then
++                    if [[ -L ${EROOT}${newsymlinks[new_i]} ]]; then
++                        :
++                    elif [[ -d ${EROOT}${newsymlinks[new_i]} ]]; then
++                        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}"
++                        errors=yes
++                    elif [[ -e ${EROOT}${newsymlinks[new_i]} ]]; then
++                        if [[ -n ${force} ]]; then
++                            write_warning_msg "Overwriting ${EROOT}${newsymlinks[new_i]} due to --force: is not a symlink"
++                        else
++                            write_error_msg "Refusing to overwrite ${EROOT}${newsymlinks[new_i]}: is not a symlink (use --force to override)"
++                            errors=yes
++                        fi
++                    fi
++
++                elif [[ ${pass} == perform ]]; then
++                    mkdir -p "${EROOT}${newsymlinks[new_i]%/*}" || die "${dieprefix}: mkdir -p failed"
++                    ln -snf "${target#/}" "${EROOT}${newsymlinks[new_i]}" || die "${dieprefix}: ln -snf failed"
++                else
++                    die "${dieprefix}: unknown \${pass} ${pass}???"
++                fi
++
++                [[ ${newsymlinks[new_i]} == ${oldsymlinks[old_i]} ]] && old_i+=1
++                new_i+=1
++            fi
++        done
++
++        [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++    done
++
++    local oldcur="$(get_current_provider)"
++    ln -snf "${provider}" "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current" || die "${dieprefix}: ln -snf failed"
++
++    : >"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: emptying/creating _current_list failed"
++    for symlink in "${newsymlinks[@]}"; do
++        echo -n -e "${symlink}\\0" >>"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list" || die "${dieprefix}: appending ${symlink} to _current_list failed"
++    done
++    return 0
++}
++
++_options_parameters() {
++    [[ -n ${2} && ${2} != --descriptions ]] && die -q "Unrecognised option ${2}"
++    local describe_func=describe_${1#options_}_options descriptions=${2} opt options oldifs=$IFS
++    if is_function ${describe_func}; then
++        IFS=$'\n'
++        options=( $(${describe_func}) )
++        IFS=$oldifs
++        for opt in "${options[@]}"; do
++            [[ ${opt} == --* ]] || continue
++            if [[ -n ${descriptions} ]]; then
++                echo "${opt/ : /:}"
++            else
++                echo "${opt%% : *}"
++            fi
++        done
++    fi
++}
++
++options_set() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++### update action ###
++
++describe_update() {
++    echo "Set a default provider if no valid one currently exists"
++}
++
++describe_update_parameters() {
++    echo "[--ignore] <provider>"
++}
++
++describe_update_options() {
++    echo "--ignore : update to any valid provider EXCEPT the specified provider"
++    echo "<provider> : the name of the provider to use"
++}
++
++do_update() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local p cur=$(get_current_provider) providers=( $(get_providers) ) ignore
++    if [[ "--ignore" == ${1} ]] ; then
++        # Try everything except setting the provider to the given
++        # one. So, if it isn't the given one, we end up doing
++        # nothing. Bug #128
++        shift
++        ignore=${1}
++    fi
++
++    if [[ ${cur} == ${1} && -z ${ignore} ]]; then
++        # if current provider was just updated, reselect it since it could have changed
++        do_set "${cur}" && return 0
++    elif [[ -n ${cur} && ${cur} != ${ignore} ]] ; then
++        # verify existing provider's symlinks
++        local p= bad=0
++        while read -r -d '' p ; do
++            [[ -L "${EROOT}${p}" && -e "${EROOT}${p}" ]] || (( bad++ ))
++        done < "${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++        [[ "${bad}" -eq 0 ]] && return 0
++        # fix existing provider if possible
++        has "${cur}" "${providers[@]}" && do_set "${cur}" && return 0
++    elif has "${1}" "${providers[@]}" && [[ -z ${ignore} ]] ; then
++        # switch to new provider if none was set before or it can't be fixed
++        do_set "${1}" && return 0
++    fi
++
++    # if no valid provider has been selected switch to first available, valid
++    # provider, sorted according to importance
++    for p in "${providers[@]}"; do
++        [[ ${ignore} != ${p} ]] && do_set "${p}" && return 0
++    done
++
++    # if a provider is set but no providers are available anymore cleanup
++    cur=$(get_current_provider)
++    if [[ -n ${cur} ]]; then
++        do_unset "${cur}" && return 2
++    fi
++    # if no provider is set and none are available that are not ignored, return 2 for cleanup
++    [[ -z ${providers[@]} || ${providers[@]} == ${ignore} ]] && return 2
++
++    # we tried everything to select a valid provider, but failed
++    return 1
++}
++
++options_update() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++### unset action ###
++
++describe_unset() {
++    echo "Unset any symlinks created for the current provider for ${ALTERNATIVE}."
++}
++
++describe_unset_parameters() {
++    echo "[ --force ]"
++}
++
++describe_unset_options() {
++    echo "--force : remove existing non-symlink files (but not directories) if necessary"
++}
++
++do_unset() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++
++    local force=
++    if [[ ${1} == --force ]]; then
++        force=yes
++        shift
++    fi
++
++    local cur="$(get_current_provider)" p=
++    [[ -n "${cur}" ]] || die -q "Nothing to unset"
++    local dieprefix="Could not unset provider for ${ALTERNATIVE}"
++
++    local one=false symlink pass errors=
++    for pass in check perform; do
++        while read -r -d '' symlink; do
++            one=true
++            if [[ ${pass} == check ]]; then
++                if [[ -L ${EROOT}${symlink} ]]; then
++                    :
++                elif [[ -d ${EROOT}${symlink} ]]; then
++                    write_error_msg "Can't remove ${EROOT}${symlink}: is a directory${force:+ which is a fatal error that cannot be ignored by --force}"
++                    errors=yes
++                elif [[ -e ${EROOT}${symlink} ]]; then
++                    if [[ -n ${force} ]]; then
++                        write_warning_msg "Removing ${EROOT}${symlink} due to --force: is not a symlink"
++                    else
++                        write_error_msg "Refusing to remove ${EROOT}${symlink}: is not a symlink (use --force to override)"
++                        errors=yes
++                    fi
++                fi
++
++            elif [[ ${pass} == perform ]]; then
++                rm -f "${EROOT}${symlink}" || die "${dieprefix}: rm failed"
++            else
++                die "${dieprefix}: unknown \${pass} ${pass}???"
++            fi
++        done <"${ALTERNATIVESDIR}/${ALTERNATIVE}/_current_list"
++
++        [[ -n ${errors} ]] && die "${dieprefix}: see previous errors"
++    done
++
++    ${one} || die "${dieprefix}: does not provide any symlinks?"
++
++    rm "${ALTERNATIVESDIR}/${ALTERNATIVE}"/{_current,_current_list} || die "${dieprefix}: rm failed"
++}
++
++options_unset() {
++    _options_parameters $FUNCNAME "$@"
++    get_current_provider
++}
++
++### script action ###
++
++describe_script() {
++    echo "Output an evalable script fragment to set PATH, LD_LIBRARY_PATH and MANPATH to use the specified provider"
++}
++
++describe_script_parameters() {
++    echo "[--sh | --csh] [<provider>]"
++}
++
++describe_script_options() {
++    echo "--sh : use Bourne shell syntax (default)"
++    echo "--csh : use C shell syntax"
++    echo "<provider> : the provider to use (if not specified, use the system default)"
++}
++
++do_script() {
++    [[ -z "${ALTERNATIVE}" ]] && die "Need to set ALTERNATIVE in the eselect module"
++    local syntax=sh
++    if [[ ${1} == --sh ]]; then
++        shift
++    elif [[ ${1} == --csh ]]; then
++        syntax=csh
++        shift
++    fi
++    local provider=${1}
++    [[ -z "${provider}" ]] && die -q "Missing required parameter 'provider'"
++    if is_number "${provider}" ; then
++        local providers=( $(get_providers) )
++        (( ${provider} <= ${#providers[@]} )) || die -q "The given provider (${provider}) does not exist"
++        provider=${providers[${provider}-1]}
++    fi
++    [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider} ]] || die -q "The given provider (${provider}) does not exist"
++
++    local variables=( PATH LD_LIBRARY_PATH MANPATH )
++    [[ -n ${!default_*} ]] && local ${!default_*}
++    local default_LD_LIBRARY_PATH=$(grep '^[^#]' "${EROOT}"/etc/ld.so.conf | tr '\n' ':')/lib:/usr/lib
++    local default_MANPATH=$(MANPATH= man -C"${EROOT}"/etc/man.conf -w)
++
++    local var IFS=:
++    for var in "${variables[@]}"; do
++        local defvar=default_${var} path paths=( )
++        for path in ${!var}; do
++            [[ ${path} == ${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/* ]] && continue
++            [[ -n ${provider} && -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++            paths+=( "${path}" )
++        done
++
++        [[ -n ${provider} ]] && for path in ${!defvar}; do
++            [[ -d ${ALTERNATIVESDIR}/${ALTERNATIVE}/${provider}/${path#/} ]] && paths+=( "${ALTERNATIVESDIR_ROOTLESS}/${ALTERNATIVE}/${provider}/${path#/}" )
++        done
++
++        local newval=${paths[*]}
++        if [[ ${newval} != ${!var} ]]; then
++            newval=${newval//\'/\'\\\'\'}
++            if [[ ${syntax} == sh ]]; then
++                echo "${var}='${newval}'; export ${var}"
++            else
++                echo "setenv ${var} '${newval}'"
++            fi
++        fi
++    done
++}
++
++options_script() {
++    _options_parameters $FUNCNAME "$@"
++    get_providers
++}
++
++# vim: set ft=eselect sw=4 sts=4 ts=4 et tw=80 :

diff --git a/app-admin/eselect/metadata.xml b/app-admin/eselect/metadata.xml
new file mode 100644
index 0000000..dbaf8c8
--- /dev/null
+++ b/app-admin/eselect/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+  <email>eselect@gentoo.org</email>
+</maintainer>
+</pkgmetadata>



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

end of thread, other threads:[~2018-04-02 11:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-07  9:18 [gentoo-commits] proj/sci:master commit in: app-admin/eselect/files/, app-admin/eselect/ Justin Lecher
  -- strict thread matches above, loose matches on Subject: below --
2018-04-02 11:20 Justin Lecher
2017-12-25 20:33 Justin Lecher
2017-04-30  7:47 Justin Lecher
2016-12-10 10:50 Justin Lecher
2016-07-31 16:09 Justin Lecher
2015-08-14  7:24 Justin Lecher
2015-05-24  8:14 Justin Lecher
2014-05-26  7:07 Justin Lecher
2013-09-02 11:16 Andrew Savchenko
2013-01-24 19:47 Sebastien Fabbro
2012-09-20 21:25 Justin Lecher
2012-01-22 22:16 Sebastien Fabbro
2011-09-06 18:04 Sebastien Fabbro
2011-08-03 23:37 Andrea Arteaga

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