public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2012-06-21 12:26 Luca Barbato
  0 siblings, 0 replies; 18+ messages in thread
From: Luca Barbato @ 2012-06-21 12:26 UTC (permalink / raw
  To: gentoo-commits

commit:     8e767488c39d9f9599d07db766352f433ecc5e1d
Author:     Luca Barbato <lu_zero <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 25 01:07:06 2012 +0000
Commit:     Luca Barbato <lu_zero <AT> gentoo <DOT> org>
CommitDate: Wed Jun 13 13:04:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=8e767488

opengl: support gles only implementation

Additionally make switching headers and libraries work for GLES OpenVG
and EGL.

---
 modules/opengl.eselect |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 2e8dd23..fa1e8f7 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -140,14 +140,15 @@ setup_extensions_symlinks() {
 
 setup_includes_symlinks() {
 	local target=$1
+	local files=$2
 	local file
+	local mdir=$3
 	local sdir
 
-	shift
-
+	shift 2
 	mkdir -p "${target}" || die "Failed to create ${target}"
 	pushd "${target}" &> /dev/null
-		for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
+		for file in ${files}; do
 			for sdir in "$@"; do
 				if [[ -e ${sdir}/${file} ]]; then
 					upgrade_file "${sdir}/${file}" "${target}"
@@ -155,6 +156,9 @@ setup_includes_symlinks() {
 				fi
 			done
 		done
+		test -d ${mdir} && for file in ${mdir}/*.h; do
+			upgrade_file "${file}" "${target}"
+		done
 	popd &> /dev/null
 }
 
@@ -165,6 +169,7 @@ set_new_implementation() {
 	local moduledir
 	local gl_dir
 	local gl_local
+	local -A gl_header
 
 	# Set a sane umask... bug #83115
 	umask 022
@@ -178,7 +183,7 @@ set_new_implementation() {
 		for libdir in $(list_libdirs); do
 			[[ ${ROOT} != / ]] && libdir=${libdir#${EROOT}}
 			[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue
-			[[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" ]] && found_libgl=yes
+			[[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" || -f "${PREFIX}/${libdir}/opengl/${gl_implem}/.gles-only" ]] && found_libgl=yes
 		done
 
 		if [[ -z ${found_libgl} ]]; then
@@ -242,14 +247,20 @@ set_new_implementation() {
 			"${PREFIX}/${libdir}/opengl/${gl_local}/extensions" \
 			"${DST_PREFIX}/${libdir}/${moduledir}/extensions"
 
-		setup_includes_symlinks \
-			"${DST_PREFIX}/include/GL" \
-			"${PREFIX}/${libdir}/opengl/${gl_implem}/include/GL/" \
-			"${PREFIX}/${libdir}/opengl/${gl_implem}/include/" \
-			"${PREFIX}/${libdir}/opengl/global/include/" \
-			"${PREFIX}/${libdir}/opengl/xorg-x11/include/GL/" \
-			"${PREFIX}/${libdir}/opengl/xorg-x11/include/"
-
+		gl_header[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h"
+		gl_header[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h"
+		gl_header[GLES2]="gl2ext.h gl2.h gl2platform.h"
+		gl_header[EGL]="eglext.h egl.h eglplatform.h"
+		gl_header[KHR]="khrplatform.h"
+		gl_header[VG]="openvg.h vgext.h vgplatform.h vgu.h"
+		for gl_dir in {EGL,GL,GLES,GLES2,KHR,VG}; do
+			setup_includes_symlinks \
+			"${DST_PREFIX}/include/${gl_dir}" \
+				"${gl_header[${gl_dir}]}" \
+			"${PREFIX}/${libdir}/opengl/${gl_implem}/include/${gl_dir}/" \
+			"${PREFIX}/${libdir}/opengl/global/include/${gl_dir}" \
+			"${PREFIX}/${libdir}/opengl/xorg-x11/include/${gl_dir}/"
+		done
 		# Setup the $LDPATH
 		if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
 			# we need this relative to ROOT



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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-01-05 15:35 Ulrich Mueller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Mueller @ 2013-01-05 15:35 UTC (permalink / raw
  To: gentoo-commits

commit:     f935850bf7bfbe8668b27524cadd14aeb22cf3aa
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  5 15:37:49 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jan  5 15:37:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=f935850b

Happy new year 2013!

---
 modules/opengl.eselect |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 6bffb74..3f59a19 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # Author:  Martin Schlemmer <azarah@gentoo.org>


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-03-11  2:16 Christoph Junghans
  0 siblings, 0 replies; 18+ messages in thread
From: Christoph Junghans @ 2013-03-11  2:16 UTC (permalink / raw
  To: gentoo-commits

commit:     bad4b2a25a93bc59427365b700de2d4e3b3c6098
Author:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 11 01:39:46 2013 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 01:39:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=bad4b2a2

xvmc.eselect: added changes from gx86, version 0.3

---
 modules/xvmc.eselect |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/xvmc.eselect b/modules/xvmc.eselect
index 9300299..aedbbd0 100644
--- a/modules/xvmc.eselect
+++ b/modules/xvmc.eselect
@@ -12,19 +12,25 @@ XVMCLIBS=(
 "libXvMCNVIDIA_dynamic.so.1"
 "libXvMC.so.1"
 "libviaXvMC.so.1"
-"libchromeXvMC.so.1"
 "libviaXvMCPro.so.1"
+"libchromeXvMC.so.1"
 "libchromeXvMCPro.so.1"
+"libXvMCVIA.so"
+"libXvMCVIAPro.so"
 "libI810XvMC.so.1"
+"/usr/lib/libIntelXvMC.so"
 "libAMDXvBA.so.1" )
 XVMCPRETTY=(
 "nvidia"
 "xorg-x11"
 "via"
-"openchrome"
 "via-pro"
+"openchrome"
 "openchrome-pro"
-"intel"
+"unichrome"
+"unichrome-pro"
+"intel-i815"
+"intel-i915"
 "ati" )
 
 get_implementation_indices() {
@@ -53,7 +59,7 @@ get_current_implementation_index() {
 
 set_new_implementation() {
 	echo -n "Switching to ${XVMCPRETTY[$1]} XvMC implementation..."
-	touch "${ROOT}/etc/X11/XvMCConfig" 2&>1 > /dev/null
+	touch "${ROOT}/etc/X11/XvMCConfig" 2>&1 > /dev/null
 	if [[ $? -eq 0 ]]; then
 		echo "${XVMCLIBS[$1]}" > "${ROOT}/etc/X11/XvMCConfig"
 		chmod 644 "${ROOT}/etc/X11/XvMCConfig"


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-03-11  2:16 Christoph Junghans
  0 siblings, 0 replies; 18+ messages in thread
From: Christoph Junghans @ 2013-03-11  2:16 UTC (permalink / raw
  To: gentoo-commits

commit:     7fa887fc34cfb4937abc8b034f3ec909404a1a2a
Author:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 11 01:50:04 2013 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 01:50:04 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=7fa887fc

xvmc.eselect: added prefix support (bug #434518)

---
 modules/xvmc.eselect |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/modules/xvmc.eselect b/modules/xvmc.eselect
index 15f8bd0..7213fcc 100644
--- a/modules/xvmc.eselect
+++ b/modules/xvmc.eselect
@@ -8,18 +8,24 @@ MAINTAINER="cardoe@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )
 
+get_libname() {
+	[[ $(uname) == "Darwin" ]] \
+		&& echo ${1:+.}${1}.dylib \
+		|| echo .so${1:+.}${1}
+}
+
 XVMCLIBS=(
-"libXvMCNVIDIA_dynamic.so.1"
-"libXvMC.so.1"
-"libviaXvMC.so.1"
-"libviaXvMCPro.so.1"
-"libchromeXvMC.so.1"
-"libchromeXvMCPro.so.1"
-"libXvMCVIA.so"
-"libXvMCVIAPro.so"
-"libI810XvMC.so.1"
-"/usr/lib/libIntelXvMC.so"
-"libAMDXvBA.so.1" )
+"libXvMCNVIDIA_dynamic$(get_libname 1)"
+"libXvMC$(get_libname 1)"
+"libviaXvMC$(get_libname 1)"
+"libviaXvMCPro$(get_libname 1)"
+"libchromeXvMC$(get_libname 1)"
+"libchromeXvMCPro$(get_libname 1)"
+"libXvMCVIA$(get_libname)"
+"libXvMCVIAPro$(get_libname)"
+"libI810XvMC$(get_libname 1)"
+"/usr/lib/libIntelXvMC$(get_libname)"
+"libAMDXvBA$(get_libname 1)" )
 XVMCPRETTY=(
 "nvidia"
 "xorg-x11"
@@ -36,7 +42,7 @@ XVMCPRETTY=(
 get_implementation_indices() {
 	local ret n
 	for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do
-		[[ -e "${ROOT}/usr/lib/${XVMCLIBS[n]##*/}" ]] && ret+=($n)
+		[[ -e "${EROOT}/usr/lib/${XVMCLIBS[n]##*/}" ]] && ret+=($n)
 	done
 
 	echo ${ret[@]}
@@ -44,8 +50,8 @@ get_implementation_indices() {
 
 get_current_implementation_index() {
 	local n
-	if [[ -f "${ROOT}/etc/X11/XvMCConfig" ]]; then
-		local current=$(< "${ROOT}/etc/X11/XvMCConfig")
+	if [[ -f "${EROOT}/etc/X11/XvMCConfig" ]]; then
+		local current=$(< "${EROOT}/etc/X11/XvMCConfig")
 		for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do
 			if [[ "${XVMCLIBS[n]}" = "${current}" ]]; then
 				echo "${n}"
@@ -59,11 +65,11 @@ get_current_implementation_index() {
 
 set_new_implementation() {
 	echo -n "Switching to ${XVMCPRETTY[$1]} XvMC implementation..."
-	touch "${ROOT}/etc/X11/XvMCConfig" 2>&1 > /dev/null
+	touch "${EROOT}/etc/X11/XvMCConfig" 2>&1 > /dev/null
 	if [[ $? -eq 0 ]]; then
-		echo "${XVMCLIBS[$1]}" > "${ROOT}/etc/X11/XvMCConfig"
-		chmod 644 "${ROOT}/etc/X11/XvMCConfig"
-		chown 0:0 "${ROOT}/etc/X11/XvMCConfig"
+		echo "${XVMCLIBS[$1]}" > "${EROOT}/etc/X11/XvMCConfig"
+		chmod 644 "${EROOT}/etc/X11/XvMCConfig"
+		[[ ${EROOT} == "/" ]] && chown 0:0 "${EROOT}/etc/X11/XvMCConfig"
 		echo " done"
 	else
 		echo " failed!"


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-03-11  2:16 Christoph Junghans
  0 siblings, 0 replies; 18+ messages in thread
From: Christoph Junghans @ 2013-03-11  2:16 UTC (permalink / raw
  To: gentoo-commits

commit:     7642e2c23f427680e384410772a2ecb331b8f1d1
Author:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 11 01:46:09 2013 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 01:46:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=7642e2c2

xvmc.eselect: added fix for intel-i815 (bug #393027)

---
 modules/xvmc.eselect |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/xvmc.eselect b/modules/xvmc.eselect
index aedbbd0..15f8bd0 100644
--- a/modules/xvmc.eselect
+++ b/modules/xvmc.eselect
@@ -29,14 +29,14 @@ XVMCPRETTY=(
 "openchrome-pro"
 "unichrome"
 "unichrome-pro"
-"intel-i815"
-"intel-i915"
+"intel-i810"
+"intel-i915/i965"
 "ati" )
 
 get_implementation_indices() {
 	local ret n
 	for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do
-		[[ -e "${ROOT}/usr/lib/${XVMCLIBS[n]}" ]] && ret+=($n)
+		[[ -e "${ROOT}/usr/lib/${XVMCLIBS[n]##*/}" ]] && ret+=($n)
 	done
 
 	echo ${ret[@]}


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-03-11  7:06 Ulrich Mueller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Mueller @ 2013-03-11  7:06 UTC (permalink / raw
  To: gentoo-commits

commit:     94c00c6ce3886bda92e128cb248b04c6bd09a4aa
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 11 07:10:46 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 07:10:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=94c00c6c

xvmc.eselect: Update year in header. Whitespace.

---
 modules/xvmc.eselect |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/xvmc.eselect b/modules/xvmc.eselect
index 96db76e..46deac5 100644
--- a/modules/xvmc.eselect
+++ b/modules/xvmc.eselect
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 DESCRIPTION="Manage the XvMC implementation used by your system"
@@ -9,9 +9,9 @@ VERSION=$(svn_date_to_version "${SVN_DATE}" )
 
 init_XVMC_vars() {
 	get_libname() {
-	[[ $(uname) == "Darwin" ]] \
-		&& echo ${1:+.}${1}.dylib \
-		|| echo .so${1:+.}${1}
+		[[ $(uname) == "Darwin" ]] \
+			&& echo ${1:+.}${1}.dylib \
+			|| echo .so${1:+.}${1}
 	}
 
 	XVMCLIBS=(


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-09-20 20:34 Ulrich Mueller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Mueller @ 2013-09-20 20:34 UTC (permalink / raw
  To: gentoo-commits

commit:     6e7c25208ba11b2e3734ad93154b261f1102af6e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 20 20:34:31 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Sep 20 20:34:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=6e7c2520

Remove trailing dot from DESCRIPTION.

---
 modules/oodict.eselect    | 2 +-
 modules/tbirddict.eselect | 2 +-
 modules/wxwidgets.eselect | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/oodict.eselect b/modules/oodict.eselect
index 9d80f6a..2aff895 100644
--- a/modules/oodict.eselect
+++ b/modules/oodict.eselect
@@ -2,7 +2,7 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-DESCRIPTION="Manage the configuration of dictionaries for OpenOffice.Org."
+DESCRIPTION="Manage the configuration of dictionaries for OpenOffice.Org"
 MAINTAINER="kevquinn@gentoo.org"
 VERSION="20100228"
 

diff --git a/modules/tbirddict.eselect b/modules/tbirddict.eselect
index c9143b6..6a8d609 100644
--- a/modules/tbirddict.eselect
+++ b/modules/tbirddict.eselect
@@ -2,7 +2,7 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-DESCRIPTION="Manage the configuration of dictionaries for Mozilla Thunderbird."
+DESCRIPTION="Manage the configuration of dictionaries for Mozilla Thunderbird"
 MAINTAINER="kevquinn@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )

diff --git a/modules/wxwidgets.eselect b/modules/wxwidgets.eselect
index 8bbec15..62333a2 100644
--- a/modules/wxwidgets.eselect
+++ b/modules/wxwidgets.eselect
@@ -4,7 +4,7 @@
 
 inherit config
 
-DESCRIPTION="Manage the system default wxWidgets profile."
+DESCRIPTION="Manage the system default wxWidgets profile"
 MAINTAINER="wxwidgets@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}")


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-11-17  8:34 Ryan Hill
  0 siblings, 0 replies; 18+ messages in thread
From: Ryan Hill @ 2013-11-17  8:34 UTC (permalink / raw
  To: gentoo-commits

commit:     ee72b9d8a6cdaaaf30bb876d69bfee1f8ea71f3f
Author:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 17 08:36:11 2013 +0000
Commit:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Sun Nov 17 08:36:11 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=ee72b9d8

Always select a profile if one is available (bug #448074).

While setting an empty profile was useful for finding ebuilds not using the
eclass, these days we have a repoman warning and a lot less SLOT
breakage.  Also remove 2.6 support from a couple places and clean up.

---
 modules/wxwidgets.eselect | 58 +++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 30 deletions(-)

diff --git a/modules/wxwidgets.eselect b/modules/wxwidgets.eselect
index 62333a2..012eb8e 100644
--- a/modules/wxwidgets.eselect
+++ b/modules/wxwidgets.eselect
@@ -1,13 +1,12 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 inherit config
 
 DESCRIPTION="Manage the system default wxWidgets profile"
 MAINTAINER="wxwidgets@gentoo.org"
-SVN_DATE='$Date$'
-VERSION=$(svn_date_to_version "${SVN_DATE}")
+VERSION="20131117"
 
 WXCONFFILE="${EROOT}"/var/lib/wxwidgets/current
 WXCONFDIR="${EROOT}"/usr/lib/wx/config
@@ -15,14 +14,13 @@ WXCONFDIR="${EROOT}"/usr/lib/wx/config
 find_targets() {
 	local conf
 	for conf in ${WXCONFDIR}/*; do
-		[[ -f ${conf} && -x ${conf} ]] && basename ${conf}
+		[[ -e ${conf} ]] && basename ${conf}
 	done
 }
 
 set_config() {
 	local target="${1}" targets
 
-	# selected by number
 	if is_number "${target}"; then
 		targets=( $(find_targets) )
 		[[ ${1} -ge 1 && ${1} -le ${#targets[@]} ]] \
@@ -30,12 +28,15 @@ set_config() {
 		target=${targets[$(( ${target} - 1 ))]}
 	fi
 
+	# we shouldn't change the profile to "none" if there are available configs
+	# this can happen if WXCONFFILE got deleted somehow
 	if [[ ${target} == "none" ]]; then
-		# none is a special case
-		:
-	else
-		[[ ! -f ${WXCONFDIR}/${target} ]] && \
-			die -q "\"${1}\" doesn't appear to be a valid profile name"
+		targets=( $(find_targets) )
+		[[ ${#targets[@]} -ge 1 ]] && target=${targets[0]}
+	fi
+
+	if [[ ! ${target} == "none" && ! -e ${WXCONFDIR}/${target} ]]; then
+		die -q "\"${1}\" doesn't appear to be a valid profile name"
 	fi
 
 	echo
@@ -90,7 +91,6 @@ describe_list() {
 
 do_list() {
 	local i targets currconf
-	# targets is an array containing names of available configs
 	targets=( $(find_targets) )
 	[[ -e ${WXCONFFILE} ]] && currconf=$(load_config ${WXCONFFILE} WXCONFIG)
 
@@ -110,7 +110,7 @@ describe_set() {
 }
 
 describe_set_options() {
-	echo "<target> : Profile name or number (from 'list' action)"
+	echo "<target> : Profile name or number (from 'list')"
 }
 
 describe_set_parameters() {
@@ -121,8 +121,8 @@ do_set() {
 	[[ ! ${#@} -eq 1 ]] \
 		&& die -q "You must specify a profile name or number"
 
-	[[ -w "${EROOT}"/var/lib ]] \
-		|| die -q "You need write permission to /var/lib to perform this action."
+	[[ ! -w "${EROOT}"/var/lib/ ]] \
+		&& die -q "You need write permission to /var/lib to perform this action."
 
 	set_config "${1}"
 }
@@ -136,9 +136,6 @@ do_update() {
 
 	currconf=$(load_config ${WXCONFFILE} WXCONFIG)
 
-	# if current config is "none" leave it alone
-	[[ ${currconf} == none ]] && return 0
-
 	# if current config is valid leave it alone
 	[[ -e ${WXCONFDIR}/${currconf} ]] && return 0
 
@@ -202,7 +199,7 @@ do_update() {
 				;;
 
 			ver)
-				for opt in 2.9 2.8 2.6; do
+				for opt in 2.9 2.8; do
 					if [[ ${opt} == ${wxver[0]} ]]; then
 						continue
 					else
@@ -216,11 +213,10 @@ do_update() {
 
 	# Now we iterate through all the installed configs and find the closest match
 	# ( debug -> char -> toolkit -> ver )
-	# meaning w/ a current config of gtk2-unicode-debug-2.6, it will pick
-	# gtk2-unicode-release-2.6 before
-	# gtk2-ansi-debug-2.6 before
-	# base-unicode-debug-2.6 before
-	# gtk2-unicode-debug-2.8
+	# meaning w/ a current config of gtk2-unicode-debug-2.8, it will pick
+	# gtk2-unicode-release-2.8 before
+	# base-unicode-debug-2.8 before
+	# gtk2-unicode-2.9
 
 	local d c t v checkconf foundconf
 
@@ -228,7 +224,7 @@ do_update() {
 		for (( t = 0 ; t < ${#wxtoolkit[@]} ; t++ )); do
 			for (( c = 0 ; c < ${#wxchar[@]} ; c++ )); do
 				for (( d = 0 ; d < ${#wxdebug[@]} ; d++ )); do
-					if [[ ${wxver[$v]} != 2.[6,8] ]]; then
+					if [[ ${wxver[$v]} != 2.8 ]]; then
 						# >=2.9 doesn't have a debug component
 						checkconf="${wxtoolkit[$t]}-${wxchar[$c]}-${wxver[$v]}"
 					else
@@ -245,12 +241,14 @@ do_update() {
 	# nothing installed
 	[[ -z ${foundconf} ]] && foundconf="none"
 
-	echo
-	write_warning_msg "Your currently selected wxWidgets profile:    ( ${currconf} )"
-	write_warning_msg "is no longer available."
-	write_warning_msg
-	write_warning_msg "The closest matching profile:                 ( ${foundconf} )"
-	write_warning_msg "will be activated in its place."
+	if [[ ${currconf} != "none" && ${foundconf} != "none" ]]; then
+		echo
+		write_warning_msg "Your currently selected wxWidgets profile:    ( ${currconf} )"
+		write_warning_msg "is no longer available."
+		write_warning_msg
+		write_warning_msg "The closest matching profile:                 ( ${foundconf} )"
+		write_warning_msg "will be activated in its place."
+	fi
 
 	do_set ${foundconf}
 }


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2013-12-30  7:49 Ryan Hill
  0 siblings, 0 replies; 18+ messages in thread
From: Ryan Hill @ 2013-12-30  7:49 UTC (permalink / raw
  To: gentoo-commits

commit:     53601797dd2e5448d655bf868be5f5b22ab9c525
Author:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 30 07:58:44 2013 +0000
Commit:     Ryan Hill <dirtyepic <AT> gentoo <DOT> org>
CommitDate: Mon Dec 30 07:58:44 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=53601797

Add support for wxGTK 3.0.

---
 modules/wxwidgets.eselect | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/wxwidgets.eselect b/modules/wxwidgets.eselect
index 012eb8e..4be13e9 100644
--- a/modules/wxwidgets.eselect
+++ b/modules/wxwidgets.eselect
@@ -6,7 +6,7 @@ inherit config
 
 DESCRIPTION="Manage the system default wxWidgets profile"
 MAINTAINER="wxwidgets@gentoo.org"
-VERSION="20131117"
+VERSION="20131230"
 
 WXCONFFILE="${EROOT}"/var/lib/wxwidgets/current
 WXCONFDIR="${EROOT}"/usr/lib/wx/config
@@ -27,7 +27,6 @@ set_config() {
 			|| die -q "Number out of range: ${1}"
 		target=${targets[$(( ${target} - 1 ))]}
 	fi
-
 	# we shouldn't change the profile to "none" if there are available configs
 	# this can happen if WXCONFFILE got deleted somehow
 	if [[ ${target} == "none" ]]; then
@@ -199,7 +198,7 @@ do_update() {
 				;;
 
 			ver)
-				for opt in 2.9 2.8; do
+				for opt in 3.0 2.9 2.8; do
 					if [[ ${opt} == ${wxver[0]} ]]; then
 						continue
 					else


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2015-01-04 10:00 Michał Górny
  0 siblings, 0 replies; 18+ messages in thread
From: Michał Górny @ 2015-01-04 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     5016bc0e375b70c576539812c7c1d110a49bd5c6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  4 09:59:13 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  4 09:59:13 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=5016bc0e

opengl: write section to xorg.conf.d only if non-empty

Write the "Files" section only if there's at least one ModulePath to
write. The empty section isn't necessary and blocks processing other
"Files" sections.

---
 modules/opengl.eselect | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 6e3df4f..bdb387b 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -66,11 +66,13 @@ get_implementations() {
 # outputs the file contents to stderr
 write_xorg_confd() {
 	local dir
-	echo 'Section "Files"'
-	for dir; do
-		echo "	ModulePath \"${dir}\""
-	done
-	echo 'EndSection'
+	if [[ -n ${@} ]]; then
+		echo 'Section "Files"'
+		for dir; do
+			echo "	ModulePath \"${dir}\""
+		done
+		echo 'EndSection'
+	fi
 }
 
 set_new_implementation() {


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2015-01-04 10:00 Michał Górny
  0 siblings, 0 replies; 18+ messages in thread
From: Michał Górny @ 2015-01-04 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     ed6aba2197f929f3a406479a3a6fcd4afcad1a82
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  8 22:57:42 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec  8 22:58:21 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=ed6aba21

opengl: create xorg.conf.d directory if missing

---
 modules/opengl.eselect | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 40b448e..6e3df4f 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -17,7 +17,7 @@ DESCRIPTION="Manage the OpenGL implementation used by your system"
 MAINTAINER="x11@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )
-EBUILD_VERSION="1.3.0"
+EBUILD_VERSION="1.3.1"
 
 # Our data
 ENV_FILE="${EROOT}/etc/env.d/000opengl"
@@ -143,6 +143,7 @@ set_new_implementation() {
 	store_config ${ENV_FILE} LDPATH "${ldpath}"
 	store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}"
 
+	mkdir -p "${XORGD_FILE%/*}" || die
 	write_xorg_confd "${xorgmodpath[@]}" >${XORGD_FILE}
 
 	do_action env update &> /dev/null


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2015-01-04 10:00 Michał Górny
  0 siblings, 0 replies; 18+ messages in thread
From: Michał Górny @ 2015-01-04 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     2ffcd1ddd6ff4a65a01133b2ed46597a6d4863e8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  7 23:48:58 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec  8 22:57:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=2ffcd1dd

opengl: rewrite not to play with symlinks

Rewrite eselect-opengl to manipulate configuration files only. Properly
configuring the dynamic linker and xorg server, we can avoid doing
anything with libGL.so and related files, and guarantee that everything
is built against xorg-x11 implementation.

---
 modules/opengl.eselect | 201 +++++++++----------------------------------------
 1 file changed, 37 insertions(+), 164 deletions(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 3f59a19..40b448e 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -17,10 +17,11 @@ DESCRIPTION="Manage the OpenGL implementation used by your system"
 MAINTAINER="x11@gentoo.org"
 SVN_DATE='$Date$'
 VERSION=$(svn_date_to_version "${SVN_DATE}" )
-EBUILD_VERSION="1.2.1"
+EBUILD_VERSION="1.3.0"
 
 # Our data
-ENV_FILE="${EROOT}/etc/env.d/03opengl"
+ENV_FILE="${EROOT}/etc/env.d/000opengl"
+XORGD_FILE="${EROOT}/etc/X11/xorg.conf.d/20opengl.conf"
 PREFIX="${EROOT}/usr"
 DST_PREFIX="${EROOT}/usr"
 unset IGNORE_MISSING
@@ -42,7 +43,7 @@ get_current_implementation() {
 }
 
 get_implementations() {
-	local ret
+	local -a ret
 	local libdir
 	local dir
 	local dir_name
@@ -52,124 +53,32 @@ get_implementations() {
 		for dir in "${PREFIX}/${libdir}"/opengl/* ; do
 			dir_name=$(basename "${dir}")
 			[[ -d ${dir} && ${dir_name} != "global" ]] || continue
-			has ${dir_name} ${ret} && continue
-			ret=${ret:+${ret} }${dir_name}
+			has ${dir_name} "${ret[@]}" && continue
+			ret+=( "${dir_name}" )
 		done
 	done
 
-	echo ${ret}
-}
-
-# 1: file
-# 2: workdir
-upgrade_file() {
-	local file=$1
-	local filename
-	local workdir=$2
-	local linkfile=$(relative_name ${file} "${workdir}")
-
-	[[ -f ${file} ]] || return
-	filename=$(basename "${file}")
-
-	if [[ -f ${filename} || ( -L ${filename} && ! -e ${filename} ) ]] ; then
-		rm -f "${filename}"* || die -q "Failed to delete ${workdir}/${filename}"
-	fi
-
-	#echo "DEBUG: ln -s \"${linkfile}\" \"${filename}\""
-	if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
-		ln -s "${linkfile}" "${filename}" || die -q "Failed to create symlink ${workdir}/${filename}"
-	fi
-}
-
-setup_soname_symlinks() {
-	local file=$1
-	local target=$2
-	local soname
-	local scanner
-
-	# if we have .so or dylib we need to make its soname symlinked
-	# in order to be easy to find and faster to grab
-	if [[ ${file} == *.so || ${file} == *.dylib ]] ; then
-		[[ ${file} == *.so ]] && scanner=scanelf || scanner="scanmacho"
-		soname=$(${scanner} -qBF '%S#p' "${file}" | head -n1)
-		[[ ${file} == *.so ]] && soname="${file%/*}"/${soname}
-		upgrade_file "${soname}" "${target}"
-	fi
-}
-
-setup_lib_symlinks() {
-	local profile_libdir=$1
-	local target=$2
-	local file
-
-	mkdir -p "${target}" || die "Failed to create ${target}"
-
-	pushd "${target}" &> /dev/null
-		# Note that lafiles are removed here and never enabled again
-		for file in libGL{,core}.la ; do
-			rm -f "${file}"* || die -q "Failed to delete ${file}"
-		done
-
-		for file in "${profile_libdir}"/lib{EGL,GL*,OpenVG}{,core}.{so,dylib,a}; do
-			upgrade_file "${file}" "${target}"
-			setup_soname_symlinks "${file}" "${target}"
-		done
-	popd &> /dev/null
-}
-
-setup_extensions_symlinks() {
-	local src=$1
-	local target=$2
-
-	if [[ -e ${src} ]] ; then
-		mkdir -p "${target}" || die "Failed to create ${target}"
-		pushd "${target}" &> /dev/null
-			# First remove old cruft symlinks
-			for file in lib{wfb,glx,dri,dri2}.{so,dylib,a}; do
-				rm -f "${file}" || die -q "Failed to delete ${targetdir}/${file}"
-			done
-
-			# regenerate symlinks
-			for file in "${src}"/*.{so,dylib,a}; do
-				upgrade_file "${file}" "${target}"
-				setup_soname_symlinks "${file}" "${target}"
-			done
-		popd &> /dev/null
-	fi
+	has xorg-x11 "${ret[@]}" || ret+=( xorg-x11 )
+	echo "${ret[*]}"
 }
 
-setup_includes_symlinks() {
-	local target=$1
-	local files=$2
-	local file
-	local mdir=$3
-	local sdir
-
-	shift 2
-	mkdir -p "${target}" || die "Failed to create ${target}"
-	pushd "${target}" &> /dev/null
-		for file in ${files}; do
-			for sdir in "$@"; do
-				if [[ -e ${sdir}/${file} ]]; then
-					upgrade_file "${sdir}/${file}" "${target}"
-					break
-				fi
-			done
-		done
-		test -d ${mdir} && for file in ${mdir}/*.h; do
-			upgrade_file "${file}" "${target}"
-		done
-	popd &> /dev/null
+# takes list of paths
+# outputs the file contents to stderr
+write_xorg_confd() {
+	local dir
+	echo 'Section "Files"'
+	for dir; do
+		echo "	ModulePath \"${dir}\""
+	done
+	echo 'EndSection'
 }
 
 set_new_implementation() {
 	local gl_implem=$1
 	local avail_implems=$(get_implementations)
 	local libdir
-	local moduledir
-	local gl_dir
-	local gl_local
-	local -A gl_header
+	local ldpath
+	local -a xorgmodpath
 
 	# Set a sane umask... bug #83115
 	umask 022
@@ -178,7 +87,7 @@ set_new_implementation() {
 		die -q "Invalid opengl implementation selected."
 	fi
 
-	if [[ -z ${IGNORE_MISSING+1} ]]; then
+	if [[ -z ${IGNORE_MISSING+1} && ${gl_implem} != xorg-x11 ]]; then
 		local found_libgl
 		for libdir in $(list_libdirs); do
 			[[ ${ROOT} != / ]] && libdir=${libdir#${EROOT}}
@@ -199,6 +108,9 @@ set_new_implementation() {
 	if [[ -f ${ENV_FILE} ]] ; then
 		rm -f "${ENV_FILE}" || die -q "Failed to remove ${ENV_FILE}"
 	fi
+	if [[ -f ${XORGD_FILE} ]] ; then
+		rm -f "${XORGD_FILE}" || die -q "Failed to remove ${ENV_FILE}"
+	fi
 
 	for libdir in $(list_libdirs); do
 		# Set libdir correctly to EROOT
@@ -208,70 +120,31 @@ set_new_implementation() {
 		# is a real lib dir, not a symlink
 		[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue
 
-		# Set moduledir
-		# only xorg module is used now can change to case when we add other
-		# implementations.
-		moduledir="xorg/modules"
-
 		# Check if opengl implementation directory exists
 		# and use xorg-x11 as fallback (mesa)
 		# If even mesa is not around then simply die
-		if [[ -d "${PREFIX}/${libdir}/opengl/${gl_implem}" ]] ; then
-			gl_local="${gl_implem}"
-			REMOVE_ONLY="false" # global variable
-		else
-			# we are moving to implementation that does not have any support
-			# for specified libdir (ie 32bit libs for mesa) so we should
-			# remove the current symlinks and continue like nothing happened.
-			REMOVE_ONLY="true" # global variable
-			gl_local=$(get_current_implementation)
-			if ! has ${gl_local} ${avail_implems}; then
-				# skipping the libdir cause there was no profile actually
-				# selected before
-				continue 2
+		if [[ -d ${PREFIX}/${libdir}/opengl/${gl_implem} ]] ; then
+			# we need this relative to ROOT
+			ldpath=${ldpath:+${ldpath}:}${PREFIX#${ROOT}}/${libdir}/opengl/${gl_implem}/lib
+			if [[ -d ${PREFIX}/${libdir}/opengl/${gl_implem}/extensions ]]; then
+				xorgmodpath+=(
+					"${PREFIX#${ROOT}}/${libdir}/opengl/${gl_implem}"
+				)
 			fi
 		fi
-
-		setup_lib_symlinks \
-			"${PREFIX}/${libdir}/opengl/${gl_local}/lib" \
-			"${DST_PREFIX}/${libdir}"
-
-		# check if the implementation has TLS libs around
-		# and install those if around
-		[[ -e ${PREFIX}/${libdir}/opengl/${gl_local}/lib/tls ]] && \
-			setup_lib_symlinks \
-				"${PREFIX}/${libdir}/opengl/${gl_local}/lib/tls" \
-				"${DST_PREFIX}/${libdir}/tls"
-
-		setup_extensions_symlinks \
-			"${PREFIX}/${libdir}/opengl/${gl_local}/extensions" \
-			"${DST_PREFIX}/${libdir}/${moduledir}/extensions"
-
-		gl_header[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h"
-		gl_header[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h"
-		gl_header[GLES2]="gl2ext.h gl2.h gl2platform.h"
-		gl_header[GLES3]="gl3ext.h gl3.h gl3platform.h"
-		gl_header[EGL]="eglext.h egl.h eglplatform.h"
-		gl_header[KHR]="khrplatform.h"
-		gl_header[VG]="openvg.h vgext.h vgplatform.h vgu.h"
-		for gl_dir in {EGL,GL,GLES,GLES2,GLES3,KHR,VG}; do
-			setup_includes_symlinks \
-			"${DST_PREFIX}/include/${gl_dir}" \
-				"${gl_header[${gl_dir}]}" \
-			"${PREFIX}/${libdir}/opengl/${gl_implem}/include/${gl_dir}/" \
-			"${PREFIX}/${libdir}/opengl/global/include/${gl_dir}" \
-			"${PREFIX}/${libdir}/opengl/xorg-x11/include/${gl_dir}/"
-		done
-		# Setup the $LDPATH
-		if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
-			# we need this relative to ROOT
-			ldpath="${ldpath:+${ldpath}:}${PREFIX#${ROOT}}/${libdir}/opengl/${gl_local}/lib"
+		# We need the global module path too
+		if [[ -d ${PREFIX}/${libdir}/xorg/modules ]]; then
+			xorgmodpath+=(
+				"${PREFIX#${ROOT}}/${libdir}/xorg/modules"
+			)
 		fi
 	done
 
 	store_config ${ENV_FILE} LDPATH "${ldpath}"
 	store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}"
 
+	write_xorg_confd "${xorgmodpath[@]}" >${XORGD_FILE}
+
 	do_action env update &> /dev/null
 
 	echo " done"


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2015-02-26  6:52 Ben de Groot
  0 siblings, 0 replies; 18+ messages in thread
From: Ben de Groot @ 2015-02-26  6:52 UTC (permalink / raw
  To: gentoo-commits

commit:     abc77eb3cee687b3743160126eb8b2f070fc9e96
Author:     Ben de Groot <yngwin <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 26 06:52:43 2015 +0000
Commit:     Ben de Groot <yngwin <AT> gentoo <DOT> org>
CommitDate: Thu Feb 26 06:52:43 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=abc77eb3

Add neovim as option to vi.eselect

---
 modules/vi.eselect | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/vi.eselect b/modules/vi.eselect
index 573ab11..2d25859 100644
--- a/modules/vi.eselect
+++ b/modules/vi.eselect
@@ -1,16 +1,17 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 DESCRIPTION="Manage /usr/bin/vi implementations"
 MAINTAINER="vim@gentoo.org"
-VERSION="1.1.8"
+VERSION="1.1.9"
 
 # find a list of vi symlink targets, best first
 find_targets() {
 	local f
 	for f in \
 			"${EROOT}"/usr/bin/vim \
+			"${EROOT}"/usr/bin/nvim \
 			"${EROOT}"/usr/bin/nvi \
 			"${EROOT}"/usr/bin/elvis \
 			"${EROOT}"/usr/bin/vile \


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2018-03-10 10:22 Ulrich Müller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Müller @ 2018-03-10 10:22 UTC (permalink / raw
  To: gentoo-commits

commit:     584b5a7d957c93a0bc620e3e15bc763ecc9d3a28
Author:     Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 11 23:20:39 2011 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar  6 16:58:42 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=584b5a7d

gnome-shell-extensions.eselect: Retroactively import version 20111211.

Taken from:
https://dev.gentoo.org/~tetromino/distfiles/eselect-gnome-shell-extensions/eselect-gnome-shell-extensions-20111211.tar.xz

 modules/gnome-shell-extensions.eselect | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/gnome-shell-extensions.eselect b/modules/gnome-shell-extensions.eselect
index 2b73c57..41123a2 100644
--- a/modules/gnome-shell-extensions.eselect
+++ b/modules/gnome-shell-extensions.eselect
@@ -6,7 +6,7 @@
 DESCRIPTION="Manage default settings for systemwide GNOME Shell extensions"
 AUTHOR="tetromino@gentoo.org"
 MAINTAINER="gnome@gentoo.org"
-SVN_DATE='$Date: 2011/09/11 18:00:00 -0400 $'
+SVN_DATE='$Date: 2011/12/11 19:00:00 -0400 $'
 VERSION=$(svn_date_to_version "${SVN_DATE}")
 
 #
@@ -38,6 +38,18 @@ gse_prepare() {
 	if [[ -e "${ETCDIR}/${CONFIG_FILE}" ]]; then
 		source "${ETCDIR}/${CONFIG_FILE}" || die -q "Failed to source ${ETCDIR}/${CONFIG_FILE}"
 		enabled=( "${enabled_saved[@]}" )
+		# Handle the *.gnome.org → *.gcampax.github.com renaming in 3.2.2
+		local e
+		for e in "${enabled_saved[@]}"; do
+			case "${e}" in
+			*.gnome.org )
+				local renamed_e=${e/%.gnome.org/.gcampax.github.com}
+				if ! has "${renamed_e}" "${enabled[@]}"; then
+					enabled=( "${enabled[@]}" "${renamed_e}" )
+				fi
+				;;
+			esac
+		done
 	fi
 }
 


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2018-03-10 10:22 Ulrich Müller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Müller @ 2018-03-10 10:22 UTC (permalink / raw
  To: gentoo-commits

commit:     235ec226de279967e6bd38fccbe2c6f074f498c3
Author:     Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  5 06:13:42 2011 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar  6 16:58:08 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=235ec226

gnome-shell-extensions.eselect: Retroactively import version 20110911.

Taken from:
https://dev.gentoo.org/~tetromino/distfiles/eselect-gnome-shell-extensions/eselect-gnome-shell-extensions-20110911.tar.xz

 modules/gnome-shell-extensions.eselect | 305 +++++++++++++++++++++++++++++++++
 1 file changed, 305 insertions(+)

diff --git a/modules/gnome-shell-extensions.eselect b/modules/gnome-shell-extensions.eselect
new file mode 100644
index 0000000..2b73c57
--- /dev/null
+++ b/modules/gnome-shell-extensions.eselect
@@ -0,0 +1,305 @@
+# -*-eselect-*-  vim: ft=eselect
+# Copyright 2009-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2 or later
+# $Id: $
+
+DESCRIPTION="Manage default settings for systemwide GNOME Shell extensions"
+AUTHOR="tetromino@gentoo.org"
+MAINTAINER="gnome@gentoo.org"
+SVN_DATE='$Date: 2011/09/11 18:00:00 -0400 $'
+VERSION=$(svn_date_to_version "${SVN_DATE}")
+
+#
+# Basic idea: eselect manages a gschema override file located in
+# /etc/eselect/gnome-shell-extensions/ that overrides GNOME Shell's
+# 'disabled-extensions' or 'enabled-extensions' (depending on
+# current shell version) GSettings key; the override file is
+# symlinked from /usr/share/glib-2.0/schemas/
+#
+
+gse_prepare() {
+	XDG_DATA_DIRS=${XDG_DATA_DIRS:="${EROOT}/usr/local/share:${EROOT}/usr/share"}
+	ETCDIR="${EROOT}/etc/eselect/gnome-shell-extensions"
+	SCHEMADIR="${EROOT}/usr/share/glib-2.0/schemas"
+	OVERRIDE_FILE="eselect-gnome-shell-extensions.gschema.override"
+	CONFIG_FILE="config"
+	if [[ ! -d "${SCHEMADIR}" ]]; then
+		die -q "No ${SCHEMADIR} directory."
+	elif [[ ! -d "${ETCDIR}" ]]; then
+		die -q "No ${ETCDIR} directory."
+	fi
+
+	warnings=()
+	errors=()
+	available=()
+	available_dirs=()
+	enabled=()
+
+	if [[ -e "${ETCDIR}/${CONFIG_FILE}" ]]; then
+		source "${ETCDIR}/${CONFIG_FILE}" || die -q "Failed to source ${ETCDIR}/${CONFIG_FILE}"
+		enabled=( "${enabled_saved[@]}" )
+	fi
+}
+
+has() {
+	# Copied from portage's isolated-functions.sh
+	local needle=$1
+	shift
+
+	local x
+	for x in "$@"; do
+		[[ "${x}" = "${needle}" ]] && return 0
+	done
+	return 1
+}
+
+gse_print_warnings() {
+	local n
+
+	for (( n = 0; n < ${#warnings[@]}; ++n )); do
+		write_warning_msg "${warnings[n]}"
+	done
+
+	for (( n = 0; n < ${#errors[@]}-1; ++n )); do
+		write_error_msg "${errors[n]}"
+	done
+	[[ ${#errors[@]} = 0 ]] && return
+	die -q "${errors[n]}"
+}
+
+gse_die() {
+	errors=( "${errors[@]}" "$@" )
+	gse_print_warnings
+	die # should not happen...
+}
+
+gse_read_available() {
+	local d
+
+	gse_prepare
+	# Do not expand * to '*' if $p is empty
+	shopt -s nullglob
+
+	for p in $(echo "${XDG_DATA_DIRS}" | tr -s ':' '\n'); do
+		pushd "${p}/gnome-shell/extensions" &> /dev/null || continue
+		for d in *; do
+			local full_d="${p}/gnome-shell/extensions/${d}"
+			# skip invalid extension directories
+			if ! [[ -d "${d}" && -f "${d}/metadata.json" && -s "${d}/metadata.json" ]]; then
+				warnings=( "${warnings[@]}" "${full_d} is not a valid extension" )
+				continue
+			fi
+			# earlier entries in XDG_DATA_DIRS take precedence
+			if has "${d}" "${available[@]}"; then
+				warnings=( "${warnings[@]}" "Skipping ${full_d}" )
+				continue
+			fi
+			available_dirs=( "${available_dirs[@]}" "${full_d}" )
+			available=( "${available[@]}" "${d}" )
+		done
+		popd > /dev/null
+	done
+	# Sort $available
+	if [[ -n "${available[@]}" ]]; then
+		eval available=( $(printf '%q\n' "${available[@]}" | sort ) )
+	fi
+}
+
+gse_write_config_file() {
+	local f="${ETCDIR}/${CONFIG_FILE}"
+
+	# Sort and uniquefy $enabled
+	eval enabled_saved=( $(printf '%q\n' "${enabled[@]}" | sort -u ) )
+
+	if [[ -e "${f}" ]]; then
+		[[ -f "${f}" && -w "${f}" ]] || gse_die "${f} is not writable"
+	else
+		[[ -w "${ETCDIR}" ]] || gse_die "${ETCDIR} is not writable"
+	fi
+
+	cat > "${f}" <<EOF || gse_die "Failed to write ${f}"
+# Generated and used by eselect gnome-shell-extensions; do not edit manually
+$(declare -p enabled_saved)
+EOF
+}
+
+gse_write_override_file() {
+	local f="${ETCDIR}/${OVERRIDE_FILE}"
+	local local key value e
+
+	case $(gnome-shell --version) in
+	"GNOME Shell 2"* | "GNOME Shell 3.0"* | "GNOME Shell 3.1."[012345678]* )
+		# <gnome-shell-3.1.90 uses 'disabled-extensions' key
+		key="disabled-extensions"
+		for e in "${available[@]}"; do
+			has "${e}" "${enabled[@]}" || value+="'${e}', "
+		done
+		value=`echo "${value}" | sed -e 's:, $::'`
+		;;
+	* )
+		# >=gnome-shell-3.1.90 uses 'enabled-extensions' key
+		key="enabled-extensions"
+		for e in "${enabled[@]}"; do
+			value+="'${e}', "
+		done
+		value=`echo "${value}" | sed -e 's:, $::'`
+		;;
+	esac
+
+	if [[ -e "${f}" ]]; then
+		[[ -f "${f}" && -w "${f}" ]] || gse_die "${f} not writable"
+	else
+		[[ -w "${ETCDIR}" ]] || gse_die "${ETCDIR}/ not writable"
+	fi
+
+	cat > "${f}" <<EOF || gse_die "Failed to write ${f}"
+# Generated and used by eselect gnome-shell-extensions; do not edit manually
+[org.gnome.shell]
+${key}=[${value}]
+EOF
+	glib-compile-schemas "${SCHEMADIR}" || gse_die "Failed to compile schemas in ${SCHEMADIR}"
+}
+
+gse_get_name() {
+	# $1 is an index into available_dirs
+	perl -e 'use JSON; undef $/; print decode_json(<>)->{name};' \
+		"${available_dirs[${1}]}/metadata.json"
+}
+
+gse_get_description() {
+	# $1 is an index into available_dirs
+	perl -e 'use JSON; undef $/; print decode_json(<>)->{description};' \
+		"${available_dirs[${1}]}/metadata.json"
+}
+
+### list action
+
+describe_list() {
+	echo "List ids of available GNOME Shell extensions"
+}
+
+describe_list_options() {
+	echo "-v, --verbose : Display extension names and descriptions"
+}
+
+do_list() {
+	local n
+
+	gse_read_available
+	write_list_start "Available extensions ($(highlight '*') means enabled for all users by default):"
+	for (( n = 0; n < ${#available[@]}; ++n )); do
+		has "${available[n]}" "${enabled[@]}" &&
+			available[n]=$(highlight_marker "${available[n]}")
+		if [[ $1 = "--verbose" || $1 = "-v" ]]; then
+			available[n]+="\n\tfull name   : $(gse_get_name $n)\n\tdescription : $(gse_get_description $n)"
+		fi
+	done
+	write_numbered_list -m "(none found)" "${available[@]}"
+	gse_print_warnings
+}
+
+### enable action
+
+describe_enable() {
+	echo "Enable specified extension(s) for all users by default"
+}
+
+describe_enable_parameters() {
+	echo "<extension>"
+}
+
+describe_enable_options() {
+	echo "<extension> : Extension id or number (from 'list' action)"
+}
+
+do_enable() {
+	local arg ext n
+
+	gse_read_available
+	for arg in "$@"; do
+		local found=
+		for (( n = 0; n < ${#available[@]}; ++n )); do
+			ext="${available[n]}"
+			if [[ "${arg}" = $((n+1)) || "${arg}" = "${ext}" ]]; then
+				has "${ext}" "${enabled[@]}" &&
+					warnings=( "${warnings[@]}" "Extension ${arg} is already enabled" )
+				# will be uniquefied in gse_write_config_file
+				enabled=( "${enabled[@]}" "${ext}" )
+				found=yes
+				break
+			fi
+		done
+		[[ ${found} = "yes" ]] || errors=( "${errors[@]}" "Failed to find extension ${arg}" )
+	done
+	gse_write_override_file
+	gse_write_config_file
+	gse_print_warnings
+}
+
+### disable action
+
+describe_disable() {
+	echo "Disable specified extension(s) for all users by default"
+}
+
+describe_disable_parameters() {
+	echo "<extension>"
+}
+
+describe_disable_options() {
+	echo "<extension> : Extension id or number (from 'list' action)"
+}
+
+gse_unenable() {
+	# remove $1 from the enabled array
+	local found e
+	local new_enabled=()
+
+	for e in "${enabled[@]}"; do
+		if [[ "$1" = "${e}" ]]; then
+			found="yes"
+		else
+			new_enabled=( "${new_enabled[@]}" "${e}" )
+		fi
+	done
+	enabled=( "${new_enabled[@]}" )
+	[[ "${found}" = "yes" ]] && return 0
+	return 1
+}
+
+do_disable() {
+	local arg ext n
+
+	gse_read_available
+	for arg in "$@"; do
+		local found=
+		for (( n = 0; n < ${#available[@]}; ++n )); do
+			ext="${available[n]}"
+			if [[ "${arg}" = $((n+1)) || "${arg}" = "${ext}" ]]; then
+				gse_unenable "${ext}" ||
+					warnings=( "${warnings[@]}" "Extension ${arg} is already marked as disabled" )
+				found=yes
+				break
+			fi
+		done
+		[[ ${found} = "yes" ]] ||
+			errors=( "${errors[@]}" "Failed to find extension ${arg}" )
+	done
+	gse_write_override_file
+	gse_write_config_file
+	gse_print_warnings
+}
+
+### update action
+
+describe_update() {
+	echo "Scan for installed extensions, disable ones that haven't been enabled"
+	echo "earlier, and update gsettings keys if GNOME Shell has been upgraded"
+}
+
+do_update() {
+	# Run this after emerging a new extension package
+	gse_read_available
+	gse_write_override_file
+	gse_print_warnings
+}


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2018-03-10 10:22 Ulrich Müller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Müller @ 2018-03-10 10:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ac014b5457ebd04df8be3d0923b9658c48410478
Author:     Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 18:32:40 2011 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar  6 16:59:55 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=ac014b54

gnome-shell-extensions.eselect: Retroactively import version 20120911.

Taken from:
https://dev.gentoo.org/~tetromino/distfiles/eselect-gnome-shell-extensions/eselect-gnome-shell-extensions-20120911.tar.xz

 modules/gnome-shell-extensions.eselect | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gnome-shell-extensions.eselect b/modules/gnome-shell-extensions.eselect
index 41123a2..788b459 100644
--- a/modules/gnome-shell-extensions.eselect
+++ b/modules/gnome-shell-extensions.eselect
@@ -6,7 +6,7 @@
 DESCRIPTION="Manage default settings for systemwide GNOME Shell extensions"
 AUTHOR="tetromino@gentoo.org"
 MAINTAINER="gnome@gentoo.org"
-SVN_DATE='$Date: 2011/12/11 19:00:00 -0400 $'
+SVN_DATE='$Date: 2012/09/11 15:00:00 -0400 $'
 VERSION=$(svn_date_to_version "${SVN_DATE}")
 
 #
@@ -169,7 +169,7 @@ gse_write_override_file() {
 [org.gnome.shell]
 ${key}=[${value}]
 EOF
-	glib-compile-schemas "${SCHEMADIR}" || gse_die "Failed to compile schemas in ${SCHEMADIR}"
+	glib-compile-schemas "${SCHEMADIR}" &> /dev/null || gse_die "'glib-compile-schemas \"${SCHEMADIR}\"' failed"
 }
 
 gse_get_name() {


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2018-08-30 16:48 Ulrich Müller
  0 siblings, 0 replies; 18+ messages in thread
From: Ulrich Müller @ 2018-08-30 16:48 UTC (permalink / raw
  To: gentoo-commits

commit:     401eb00243cf700210d11b58d3603bc41545b141
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 30 16:48:18 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Aug 30 16:48:18 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=401eb002

wxwidgets.eselect: Update version number.

 modules/wxwidgets.eselect | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/wxwidgets.eselect b/modules/wxwidgets.eselect
index b1abc1c..dc13704 100644
--- a/modules/wxwidgets.eselect
+++ b/modules/wxwidgets.eselect
@@ -6,7 +6,7 @@ inherit config multilib
 
 DESCRIPTION="Manage the system default wxWidgets profile"
 MAINTAINER="wxwidgets@gentoo.org"
-VERSION="20140423"
+VERSION="20180529"
 
 WXCONFFILE="${EROOT}"/var/lib/wxwidgets/current
 


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

* [gentoo-commits] proj/eselect:extern commit in: modules/
@ 2020-05-09  2:22 Patrick McLean
  0 siblings, 0 replies; 18+ messages in thread
From: Patrick McLean @ 2020-05-09  2:22 UTC (permalink / raw
  To: gentoo-commits

commit:     4fd0650ed9ef4cec5477038fcfb2e59db2cf2b93
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Sat May  9 02:21:40 2020 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Sat May  9 02:22:21 2020 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4fd0650e

modules/iptables.eselect: Complete rewrite, solve issues in bug #721578

Signed-off-by: Patrick McLean <patrick.mclean <AT> sony.com>

 modules/iptables.eselect | 320 +++++++++++++++++++++++++++++++----------------
 1 file changed, 214 insertions(+), 106 deletions(-)

diff --git a/modules/iptables.eselect b/modules/iptables.eselect
index f94b25c..e3e5906 100644
--- a/modules/iptables.eselect
+++ b/modules/iptables.eselect
@@ -2,43 +2,128 @@
 # Copyright 2005-2020 Gentoo Authors
 # Distributed under the terms of the GNU GPL version 2 or later
 
-DESCRIPTION="Manage the iptables and ip6tables symlink"
-AUTHOR="chris@christopherpritchard.co.uk"
+inherit package-manager
+
+DESCRIPTION="Manage the iptables/arptables/ebtables symlinks"
 MAINTAINER="base-system@gentoo.org"
-VERSION="20200319"
+VERSION="20200508"
+
+# a simple list of symlinks does for iptables
+IPTABLES_SYMLINKS=(
+	"iptables-xml"
+	"iptables" "iptables-restore" "iptables-save"
+)
+IP6TABLES_SYMLINKS=(
+	"ip6tables" "ip6tables-restore" "ip6tables-save"
+)
+
+# for arptables and ebtables we map names to legacy targets
+ARPTABLES_TARGETS=(
+	"arptables-legacy"
+	"xtables-nft-multi"
+)
+declare -A ARPTABLES_SYMLINKS=(
+	[arptables]="arptables-legacy"
+	[arptables-restore]="arptables-legacy-restore"
+	[arptables-save]="arptables-legacy-save"
+)
+
+EBTABLES_TARGETS=(
+	"ebtables-legacy"
+	"xtables-nft-multi"
+)
+declare -A EBTABLES_SYMLINKS=(
+	[ebtables]="ebtables-legacy"
+	[ebtables-restore]="ebtables-legacy-restore"
+	[ebtables-save]="ebtables-legacy-save"
+)
 
-IPTABLES_TARGETS=("iptables" "iptables-restore" "iptables-save")
-IP6TABLES_TARGETS=("ip6tables" "ip6tables-restore" "ip6tables-save")
+# get which module is running
+get_module() {
+	local module
+	module="${BASH_SOURCE[0]##*/}"
 
-# find a list of xtables symlink targets
+	printf -- '%s\n' "${module%.eselect}"
+}
+
+# find a list of symlink targets for the current module
 find_targets() {
-	local f
-	for f in "${EROOT}"/sbin/xtables-*-multi; do
-		[[ -f ${f} ]] && basename "${f}"
-	done
+	local module target
+
+	module="$(get_module)"
+	case "${module}" in
+		iptables)
+			for target in "${EROOT}"/sbin/xtables-*-multi; do
+				[[ -x ${target} ]] && printf -- '%s\n' "${target##*/}"
+			done
+		;;
+		arptables)
+			for target in "${ARPTABLES_TARGETS[@]}"; do
+				[[ -x ${EROOT}/sbin/${target} ]] && printf -- '%s\n' "${target}"
+			done
+		;;
+		ebtables)
+			for target in "${EBTABLES_TARGETS[@]}"; do
+				[[ -x ${EROOT}/sbin/${target} ]] && printf -- '%s\n' "${target}"
+			done
+		;;
+		*) die "Invalid module name ${module}"
+	esac
 }
 
-# remove the iptables symlink
-remove_symlinks() {
-	local ipt
-	for ipt in "${IPTABLES_TARGETS[@]}"; do
-		rm -f "${EROOT}/sbin/${ipt}" &>/dev/null
-	done
-	if [[ -n ${ipv6} && -n ${ipv6_remove} ]]; then
-		local ip6t
-		for ip6t in "${IP6TABLES_TARGETS[@]}"; do
-			rm -f "${EROOT}/sbin/${ip6t}" &>/dev/null
-		done
-	fi
+# get the list of symlinks for the current module
+get_symlinks_list() {
+	local module
+	module="$(get_module)"
+
+	case "${module}" in
+		iptables)
+			printf -- '%s\n' "${IPTABLES_SYMLINKS[@]}"
+
+			if [[ ${1} == -a ]] || has_version 'net-firewall/iptables[ipv6]'
+			then
+				printf -- '%s\n' "${IP6TABLES_SYMLINKS[@]}"
+			fi
+		;;
+		arptables) printf -- '%s\n' "${!ARPTABLES_SYMLINKS[@]}";;
+		ebtables) printf -- '%s\n' "${!EBTABLES_SYMLINKS[@]}";;
+		*) die "Invalid module name ${module}"
+	esac
+}
+
+# get the symlink target given a symlink name and the target implementation
+get_symlink_target() {	
+	local link="${1}" target="${2}" module
+	module="$(get_module)"
+
+	case "${module}" in
+		iptables) printf -- '%s\n' "${target}";;
+		arptables)
+			if [[ ${target} == *-legacy ]]; then
+				printf -- '%s\n' "${ARPTABLES_SYMLINKS[${link}]}"
+			else
+				printf -- '%s\n' "${target}"
+			fi
+		;;
+		ebtables)
+			if [[ ${target} == *-legacy ]]; then
+				printf -- '%s\n' "${EBTABLES_SYMLINKS[${link}]}"
+			else
+				printf -- '%s\n' "${target}"
+			fi
+		;;
+		*) die "Invalid module name ${module}"
+	esac
 }
 
-# set the iptables symlink
+# set the symlinks for the current target
 set_symlinks() {
 	local target="${1}"
+	local retval=0
 
 	if is_number "${target}" && [[ ${target} -ge 1 ]]; then
 		local -a targets
-		readarray -t targets <<< "$(find_targets)"
+		readarray -t targets < <(find_targets)
 		target=${targets[$((target-1))]}
 	fi
 
@@ -46,130 +131,153 @@ set_symlinks() {
 		die -q "Target \"${target}\" doesn't appear to be valid!"
 	fi
 
-	local ipt
-	for ipt in "${IPTABLES_TARGETS[@]}"; do
-	  ln -s "${target}" "${EROOT}/sbin/${ipt}"
-	done
+	# create an array of symlinks to be created, then create them
+	# in a separate pass, it's done this way in an attempt to be atomic
+	# either all symlinks get updated, or none
+	local -a symlinks_list
+	readarray -t symlinks_list < <(get_symlinks_list)
+
+	local symlink
+	local -A do_symlinks
+	for symlink in "${symlinks_list[@]}"; do
+		local symlink_path="${EROOT}/sbin/${symlink}"
+
+		if [[ -L ${symlink_path} || ! -e ${symlink_path} ]]; then
+			do_symlinks["${symlink_path}"]="$(get_symlink_target "${symlink}" "${target}")"
 	
-	if [[ -n ${ipv6} ]]; then
-		local ip6t
-		for ip6t in "${IP6TABLES_TARGETS[@]}"; do
-			ln -s "${target}" "${EROOT}/sbin/${ip6t}"
-		done
-	fi
+		else
+			die -q "Could not create symlink at ${symlink_path}:" \
+				"path exits and is not a symlink"
+		fi
+	done
+
+	for symlink in "${!do_symlinks[@]}"; do
+		if ! ln -sfn "${do_symlinks["${symlink}"]}" "${symlink}"; then
+			write_error_message "Failed to create symlink at ${symlink}"
+			retval=1
+		fi
+	done
+
+	return "${retval}"
 }
 
 ### show action ###
 
 describe_show() {
-	echo "Show the current iptables symlink"
+	printf -- 'Show the current %s symlink\n' "$(get_module)"
 }
 
 do_show() {
-	local ipv6
-	if [[ -d ${EROOT}/var/lib/ip6tables ]]; then
-		ipv6=1
-	fi
-	write_list_start "Current iptables symlinks:"
-	local ipt all_unset=1
-	for ipt in "${IPTABLES_TARGETS[@]}"; do
-		if [[ -L ${EROOT}/sbin/${ipt} ]]; then
-			local ipta
-			ipta=$(canonicalise "${EROOT}/sbin/${ipt}")
-			write_kv_list_entry "${ipt}" "${ipta%/}"
+	local -a symlinks_list
+	readarray -t symlinks_list < <(get_symlinks_list)
+
+	local all_unset=1 symlink
+	write_list_start "Current $(get_module) symlinks:"
+	for symlink in "${symlinks_list[@]}"; do
+		symlink_path="${EROOT}/sbin/${symlink}"
+
+		if [[ -L ${symlink_path} ]]; then
+			local symlink_target
+			symlink_target=$(canonicalise "${symlink_path}")
+			write_kv_list_entry "${symlink}" "${symlink_target%/}"
 			all_unset=0
-		else
-			write_kv_list_entry "${ipt}" "(unset)"
+		elif [[ ! -f ${symlink_path} ]]; then
+			write_kv_list_entry "${symlink}" "(unset)"
 	  fi
 	done
-	if [[ ${ipv6} -eq 1 ]]; then
-		write_list_start "Current ip6tables symlinks:"
-		local ip6t
-		for ip6t in "${IP6TABLES_TARGETS[@]}"; do
-			if [[ -L ${EROOT}/sbin/${ip6t} ]]; then
-				local ipta
-				ipta=$(canonicalise "${EROOT}/sbin/${ip6t}")
-				write_kv_list_entry "${ip6t}" "${ipta%/}"
-				all_unset=0
-			else
-				write_kv_list_entry "${ip6t}" "(unset)"
-			fi
-		done
-	fi
+
 	return "${all_unset}"
 }
 ### list action ###
 
 describe_list() {
-	echo "List available iptables symlink targets"
+	printf -- 'List available %s symlink targets\n' "$(get_module)"
 }
 
 do_list() {
-	local ipv6
-	local -a targets
-	readarray -t targets <<< "$(find_targets)"
-	if [[ -L ${EROOT}/var/lib/ip6tables ]]; then
-		ipv6=1
-	fi
-	write_list_start "Available iptables symlink targets:"
-	local i
-	for (( i = 0; i < ${#targets[@]}; i++ )); do
-		# highlight the target where the symlink is pointing to
-		[[ ${targets[i]} = \
-			$(basename "$(canonicalise "${EROOT}/sbin/iptables")") ]] \
-			&& targets[i]=$(highlight_marker "${targets[i]}")
+	local module
+	module="$(get_module)"
+
+	local -a targets_list symlinks_list
+	readarray -t targets_list < <(find_targets)
+	readarray -t symlinks_list < <(get_symlinks_list)
+
+	local -a targets_output
+
+	write_list_start "Available ${module} symlink targets:"
+	local symlink current_target
+	for symlink in "${symlinks_list[@]}"; do
+		local symlink_path="${EROOT}/sbin/${symlink}"
+		local target
+		for target in "${targets_list[@]}"; do
+			local symlink_target resolved_target
+			symlink_target="$(get_symlink_target "${symlink}" "${target}")"
+			resolved_target="$(basename "$(canonicalise "${symlink_path}")")"
+
+			if [[ ${resolved_target} == "${symlink_target}" ]]; then
+				if [[ -z ${current_target} ]]; then
+					current_target="${target}"
+					break
+				elif [[ ${current_target} != "${target}" ]]; then
+					write_warning_msg "Target mismatch"
+					unset current_target
+					break 2
+				fi
+			fi
+		done
+	done
+	for target in "${targets_list[@]}"; do
+		if [[ ${target} == "${current_target}" ]]; then
+			targets_output+=("$(highlight_marker "${target}")")
+		else
+			targets_output+=("${target}")
+		fi
 	done
-	write_numbered_list -m "(none found)" "${targets[@]}"
+
+	write_numbered_list -m "(none found)" "${targets_output[@]}"
 }
 
 ### set action ###
 
 describe_set() {
-	echo "Set a new iptables symlink target"
-}
-
-describe_set_parameters() {
-	echo "[--ipv6] <target>"
+	printf "Set a new $(get_module) symlink target\\n"
 }
 
 describe_set_options() {
-	echo "--ipv6: Forces creation of ip6tables symlinks"
-	echo "target : Target name or number (from 'list' action)"
+	printf -- "target : Target name or number (from 'list' action)\\n"
 }
 
 do_set() {
-	local ipv6 ipv6_remove
-	if [[ ${1} == "--ipv6" ]]; then
-		ipv6=1
-		shift
-	fi
 	local target="${1}"
 
 	[[ -z ${target} ]] && die -q "You didn't tell me what to set the symlink to"
-	[[ ${#} -gt 2 ]] && die -q "Too many parameters"
+	[[ ${#} -gt 1 ]] && die -q "Too many parameters"
 
-	if [[ -d ${EROOT}/var/lib/ip6tables ]]; then
-		ipv6=1
-		[[ -L ${EROOT}/sbin/ip6tables ]] && ipv6_remove=1
-	fi
-	if [[ -L ${EROOT}/sbin/iptables ]]; then
-		# existing symlink
-		remove_symlinks || die -q "Couldn't remove existing symlink"
-		set_symlinks "${target}" || die -q "Couldn't set a new symlink"
-	elif [[ -e ${EROOT}/sbin/iptables ]]; then
-		# we have something strange
-		die -q "${EROOT}/sbin/iptables exists but is not a symlink"
-	else
-		set_symlinks "${target}" || die -q "Couldn't set a new symlink"
-	fi
+	set_symlinks "${target}" || die -q "Couldn't set symlinks"
 }
 
 ### unset action ###
 
 describe_unset() {
-	echo "Unset iptables symlink targets"
+	printf -- 'Unset %s symlink targets\n' "$(get_module)"
 }
 
 do_unset() {
-	remove_symlinks
+	local retval=0
+
+	local -a symlinks_list
+	readarray -t symlinks_list < <(get_symlinks_list -a)
+
+	local symlink
+	for symlink in "${symlinks_list[@]}"; do
+		local symlink_path="${EROOT}/sbin/${symlink}"
+		if [[ -L ${symlink_path} ]]; then
+			unlink "${symlink_path}" || retval=${?}
+		elif [[ -e ${symlink_path} ]]; then
+			write_error_msg "Not removing non-symlink \"${symlink_path}\""
+			retval=1
+		fi
+	done
+
+	return ${retval}
 }


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

end of thread, other threads:[~2020-05-09  2:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-10 10:22 [gentoo-commits] proj/eselect:extern commit in: modules/ Ulrich Müller
  -- strict thread matches above, loose matches on Subject: below --
2020-05-09  2:22 Patrick McLean
2018-08-30 16:48 Ulrich Müller
2018-03-10 10:22 Ulrich Müller
2018-03-10 10:22 Ulrich Müller
2015-02-26  6:52 Ben de Groot
2015-01-04 10:00 Michał Górny
2015-01-04 10:00 Michał Górny
2015-01-04 10:00 Michał Górny
2013-12-30  7:49 Ryan Hill
2013-11-17  8:34 Ryan Hill
2013-09-20 20:34 Ulrich Mueller
2013-03-11  7:06 Ulrich Mueller
2013-03-11  2:16 Christoph Junghans
2013-03-11  2:16 Christoph Junghans
2013-03-11  2:16 Christoph Junghans
2013-01-05 15:35 Ulrich Mueller
2012-06-21 12:26 Luca Barbato

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