public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2017-05-22 11:27 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2017-05-22 11:27 UTC (permalink / raw
  To: gentoo-commits

commit:     3cb21a09eff8693ddd7eb8de3b7903ab623a6c53
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon May 22 11:26:50 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon May 22 11:26:50 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=3cb21a09

Fix regex in profile module.

* modules/profile.eselect (set_symlink): Fix regex, bug 614008.

 ChangeLog               | 4 ++++
 modules/profile.eselect | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6deef3a..11bc25d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-22  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/profile.eselect (set_symlink): Fix regex, bug 614008.
+
 2017-05-06  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/kernel.eselect (do_set): Don't remove the old symlink

diff --git a/modules/profile.eselect b/modules/profile.eselect
index 8d95c01..c14f394 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -98,7 +98,7 @@ set_symlink() {
 		repopath=$(get_repo_path "${repo}") || die -q "get_repo_path failed"
 		# do a reverse lookup and find the arch associated with ${target}
 		parch=$(sed -n -e \
-			"s|^\([[:alnum:]_-]\+\)[[:space:]].*${target}[[:space:]].*$|\1|p" \
+			"s|^\([[:alnum:]_-]\+\)[[:space:]]\+${target}[[:space:]].*$|\1|p" \
 			"${repopath}/profiles/profiles.desc")
 		[[ ${arch} != "${parch}" && -z ${force} ]] \
 			&& die -q "${target} is not a valid profile for ${arch}"


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2023-08-07 16:22 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2023-08-07 16:22 UTC (permalink / raw
  To: gentoo-commits

commit:     e1577d699cfc3eb60b245c8488062a43e8cece22
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  7 16:21:04 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Aug  7 16:21:04 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=e1577d69

Update lists in editor and visual modules

* modules/editor.eselect (EDITOR_LIST):
* modules/visual.eselect (EDITOR_LIST): Add vim; drop ed, ex, vi
and xemacs. Bug 911792.

Bug: https://bugs.gentoo.org/911792
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog              | 6 ++++++
 modules/editor.eselect | 4 ++--
 modules/visual.eselect | 4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 932edc3..aa50140 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-08-07  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/editor.eselect (EDITOR_LIST):
+	* modules/visual.eselect (EDITOR_LIST): Add vim; drop ed, ex, vi
+	and xemacs. Bug 911792.
+
 2023-07-08  Ulrich Müller  <ulm@gentoo.org>
 
 	* bin/eselect.in (PATH): Avoid subshell.

diff --git a/modules/editor.eselect b/modules/editor.eselect
index 488d598..4304fb5 100644
--- a/modules/editor.eselect
+++ b/modules/editor.eselect
@@ -1,11 +1,11 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 2009-2020 Gentoo Authors
+# Copyright 2009-2023 Gentoo Authors
 # Distributed under the terms of the GNU GPL version 2 or later
 
 EDITOR_VAR="EDITOR"
 EDITOR_ENVFILE="/etc/env.d/99editor"
 # list of most common cases only
-EDITOR_LIST="nano ed emacs ex vi xemacs"
+EDITOR_LIST="nano emacs vim"
 
 inherit editor-variable
 

diff --git a/modules/visual.eselect b/modules/visual.eselect
index 527793e..01c25b5 100644
--- a/modules/visual.eselect
+++ b/modules/visual.eselect
@@ -1,11 +1,11 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 2009-2021 Gentoo Authors
+# Copyright 2009-2023 Gentoo Authors
 # Distributed under the terms of the GNU GPL version 2 or later
 
 EDITOR_VAR="VISUAL"
 EDITOR_ENVFILE="/etc/env.d/99editor"
 # list of most common cases only
-EDITOR_LIST="nano emacs vi xemacs"
+EDITOR_LIST="nano emacs vim"
 
 inherit editor-variable
 


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2023-06-12 16:24 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2023-06-12 16:24 UTC (permalink / raw
  To: gentoo-commits

commit:     cc4270eeb9b737ecd4332b417524976ede25a323
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 12 15:56:19 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jun 12 15:56:19 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=cc4270ee

env.eselect: More robust file type detection

* modules/env.eselect (is_envfile): Make detection of text file
more robust. Bug 908401.

Bug: https://bugs.gentoo.org/908401
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog           | 3 +++
 modules/env.eselect | 9 +++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a5532ba..96cee04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2023-06-12  Ulrich Müller  <ulm@gentoo.org>
 
+	* modules/env.eselect (is_envfile): Make detection of text file
+	more robust. Bug 908401.
+
 	* misc/eselect-mode.el (eselect-mode): Drop XEmacs compatibility
 	code.
 

diff --git a/modules/env.eselect b/modules/env.eselect
index 6334d7c..7161e10 100644
--- a/modules/env.eselect
+++ b/modules/env.eselect
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright 2005-2020 Gentoo Authors
+# Copyright 2005-2023 Gentoo Authors
 # Distributed under the terms of the GNU GPL version 2 or later
 
 inherit config multilib package-manager
@@ -46,9 +46,10 @@ is_envfile() {
 	[[ -n ${envfile##*~} ]] || return 1
 	[[ ${envfile##*.} != bak ]] || return 1
 
-	mime=$(POSIXLY_CORRECT=1 file -i "${envfile}" \
-		| cut -d ' ' -f 2 | sed -e 's/;$//')
-	if ! has ${mime} ${MIME_WHITELIST}; then
+	mime=$(POSIXLY_CORRECT=1 file -bi -e soft "${envfile}") \
+		|| die "'file' command failed"
+	mime=${mime%%;*}
+	if ! has "${mime}" ${MIME_WHITELIST}; then
 		echo "Skipping non-text file ${envfile}."
 		return 1
 	fi


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2019-11-28 13:16 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2019-11-28 13:16 UTC (permalink / raw
  To: gentoo-commits

commit:     4201251a4b29d50f90616f6d40b1112fd3620749
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 28 13:16:05 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Nov 28 13:16:05 2019 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4201251a

rc.eselect: Add missing quotes.

* modules/rc.eselect (show_script_status): Quote strings to
prevent globbing, bug 701382.

Bug: https://bugs.gentoo.org/701382
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog          | 5 +++++
 modules/rc.eselect | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dbddf71..6292c9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-28  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/rc.eselect (show_script_status): Quote strings to
+	prevent globbing, bug 701382.
+
 2019-09-04  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.15.

diff --git a/modules/rc.eselect b/modules/rc.eselect
index 53f08c4..4a3c16d 100644
--- a/modules/rc.eselect
+++ b/modules/rc.eselect
@@ -74,13 +74,13 @@ show_script_status() {
 	done
 	case ${status} in
 		stopped)
-			write_kv_list_entry ${script} [${x}]
+			write_kv_list_entry ${script} "[${x}]"
 			;;
 		started)
-			write_kv_list_entry ${script} "$(highlight [${x}])"
+			write_kv_list_entry ${script} "$(highlight "[${x}]")"
 			;;
 		*)
-			write_kv_list_entry ${script} "$(highlight_warning [${x}])"
+			write_kv_list_entry ${script} "$(highlight_warning "[${x}]")"
 			;;
 	esac
 }


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2018-01-24 10:03 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2018-01-24 10:03 UTC (permalink / raw
  To: gentoo-commits

commit:     4651aedbef225455ee5679b1997573b14834dcfb
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 24 09:34:02 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jan 24 09:34:02 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4651aedb

Workaround for OpenRC commands not in PATH in rc module.

* modules/rc.eselect (show_script_status): Add /lib64/rc/bin
to PATH as well, workaround for bug 645240 until OpenRC is fixed.

 ChangeLog          | 5 +++++
 modules/rc.eselect | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3846850..66b7e4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-24  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/rc.eselect (show_script_status): Add /lib64/rc/bin
+	to PATH as well, workaround for bug 645240 until OpenRC is fixed.
+
 2018-01-23  Ulrich Müller  <ulm@gentoo.org>
 
 	* libs/package-manager.bash.in (arch): Restore sparc64 which was

diff --git a/modules/rc.eselect b/modules/rc.eselect
index f364f8b..ff45d58 100644
--- a/modules/rc.eselect
+++ b/modules/rc.eselect
@@ -64,7 +64,7 @@ find_unused_scripts() {
 # output list entry for script $1 and show its status
 show_script_status() {
 	local script=$1 status=unknown x
-	local PATH=/lib/rc/bin:${PATH} # path to service_* commands
+	local PATH=/lib/rc/bin:/lib64/rc/bin:${PATH} # path to service_* commands
 
 	for x in stopping starting inactive started stopped; do
 		if service_${x} ${script}; then


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2018-01-08 23:30 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2018-01-08 23:30 UTC (permalink / raw
  To: gentoo-commits

commit:     a25b292e4feaab4b3c073eeb1ed96166893e2d2b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  8 23:29:45 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jan  8 23:29:45 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=a25b292e

Show the profiles' status in the profile module's list output.

* modules/profile.eselect (find_targets): Add a fourth field for
the profiles' status to the output.
(set_symlink): Account for the change in find_targets.
(do_list): Also show the profiles' status, but only in non-brief
output mode. Bug 643864.

 ChangeLog               |  8 ++++++++
 modules/profile.eselect | 23 ++++++++++++++---------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 97dd57f..57e768e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-01-08  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/profile.eselect (find_targets): Add a fourth field for
+	the profiles' status to the output.
+	(set_symlink): Account for the change in find_targets.
+	(do_list): Also show the profiles' status, but only in non-brief
+	output mode. Bug 643864.
+
 2017-12-25  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.4.10.

diff --git a/modules/profile.eselect b/modules/profile.eselect
index c9a1edc..de85f90 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -42,7 +42,7 @@ get_repo_path() {
 }
 
 # get a list of valid profiles
-# returns a line <repo>::<repo_path>::<profile> for every profile
+# returns a line <repo>::<repo_path>::<profile>::<status> for every profile
 find_targets() {
 	local arch desc repos repo_paths i p
 
@@ -60,7 +60,8 @@ find_targets() {
 		[[ -r ${desc} ]] || continue
 		# parse profiles.desc and find profiles suitable for arch
 		for p in $(sed -n -e \
-			"s|^${arch}[[:space:]]\+\([^[:space:]]\+\).*$|\1|p" "${desc}")
+			"s|^${arch}[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+\([^[:space:]]\+\).*$|\1::\2|p" \
+			"${desc}")
 		do
 			echo "${repos[i]}::${repo_paths[i]}::${p}"
 		done
@@ -85,6 +86,7 @@ set_symlink() {
 		target=${targets[target-1]}
 		repo=${target%%::*}; target=${target#*::}
 		repopath=${target%%::*}; target=${target#*::}
+		target=${target%%::*}
 	elif [[ -n ${target} ]]; then
 		# if the profile was explicitly specified (rather than a number)
 		# double check and make sure it's valid
@@ -174,7 +176,7 @@ describe_list() {
 }
 
 do_list() {
-	local targets active i target repo repopath
+	local targets active i target repo repopath status disp
 
 	targets=( $(find_targets) )
 	[[ ${#targets[@]} -eq 0 ]] \
@@ -187,13 +189,16 @@ do_list() {
 		target=${targets[i]}
 		repo=${target%%::*}; target=${target#*::}
 		repopath=${target%%::*}; target=${target#*::}
-		if [[ ${repo} == "${DEFAULT_REPO}" ]]; then
-			targets[i]=${target}
-		else
-			targets[i]=${repo}:${target}
+		status=${target#*::}; status=${status%%::*}
+		target=${target%%::*}
+		disp=${target}
+		[[ ${repo} != "${DEFAULT_REPO}" ]] && disp=${repo}:${disp}
+		if ! is_output_mode brief; then
+			disp+=" (${status})"
+			[[ $(canonicalise "${repopath}/profiles/${target}") \
+				== "${active}" ]] && disp=$(highlight_marker "${disp}")
 		fi
-		[[ $(canonicalise "${repopath}/profiles/${target}") == "${active}" ]] \
-			&& targets[i]=$(highlight_marker "${targets[i]}")
+		targets[i]=${disp}
 	done
 	write_list_start "Available profile symlink targets:"
 	write_numbered_list "${targets[@]}"


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2017-12-25 11:00 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2017-12-25 11:00 UTC (permalink / raw
  To: gentoo-commits

commit:     b4cf6bfdc8ad3908637f5ab068f6c323bb32fe6b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 25 09:40:26 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 25 09:40:26 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=b4cf6bfd

Check for valid news item format.

* modules/news.eselect (do_list): Check for valid news item format.

 ChangeLog            |  2 ++
 modules/news.eselect | 30 ++++++++++++++++++++----------
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 648e874..55e5bb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-12-25  Ulrich Müller  <ulm@gentoo.org>
 
+	* modules/news.eselect (do_list): Check for valid news item format.
+
 	* libs/core.bash.in (eval): Make it fatal again, after more than
 	one year of transition time.
 

diff --git a/modules/news.eselect b/modules/news.eselect
index 15cf985..b0e9695 100644
--- a/modules/news.eselect
+++ b/modules/news.eselect
@@ -172,7 +172,7 @@ describe_list() {
 }
 
 do_list() {
-	local item stat repo dir header line title posted i=1
+	local item stat repo dir header line format title posted i=1
 	local cols=${COLUMNS:-80} ifs_save=${IFS}
 	local -a repos dirs
 
@@ -185,16 +185,26 @@ do_list() {
 		title="(${item} - no title)"
 		posted=${item:0:10}
 		[[ ${posted} == +([0-9])-+([0-9])-+([0-9]) ]] || posted="(no date) "
-		header=$(read_item "${dir}" "${item}" header) \
-			|| title="(${item} - removed?)"
-		local IFS=$'\n'
-		for line in ${header}; do
-			case "${line%%:*}" in
-				Title) title=${line##*([^:]):*([[:space:]])} ;;
-				Posted) posted=${line##*([^:]):*([[:space:]])} ;;
+		if header=$(read_item "${dir}" "${item}" header); then
+			local IFS=$'\n'
+			for line in ${header}; do
+				case "${line%%:*}" in
+					Title) title=${line##*([^:]):*([[:space:]])} ;;
+					Posted) posted=${line##*([^:]):*([[:space:]])} ;;
+					News-Item-Format) format=${line##*([^:]):*([[:space:]])} ;;
+				esac
+			done
+			IFS=${ifs_save}
+			case ${format} in
+				1.*|2.*) ;;
+				*)
+					title="(${item} - unknown format ${format})"
+					posted=""
+					;;
 			esac
-		done
-		IFS=${ifs_save}
+		else
+			title="(${item} - removed?)"
+		fi
 		[[ ${repo} != gentoo ]] && title="[${repo}] ${title}"
 		line="${posted}$(space $((10 - ${#posted})))  ${title}"
 		# truncate the line if it is too long


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2017-05-06 13:24 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2017-05-06 13:24 UTC (permalink / raw
  To: gentoo-commits

commit:     5fd090827d2f4464245bbd454371c040358d6b1d
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat May  6 13:04:58 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat May  6 13:04:58 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=5fd09082

Improved error checking in kernel module.

* modules/kernel.eselect (do_set): Don't remove the old symlink
before we know that we have a valid new target. Simplify.
(set_symlink): Check if the new link target is valid, then remove
any old symlink, then set the new one.
(remove_symlink): Use rm -f.

 ChangeLog              |  6 ++++++
 modules/kernel.eselect | 32 ++++++++++++++++----------------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2b356bd..6deef3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-05-06  Ulrich Müller  <ulm@gentoo.org>
 
+	* modules/kernel.eselect (do_set): Don't remove the old symlink
+	before we know that we have a valid new target. Simplify.
+	(set_symlink): Check if the new link target is valid, then remove
+	any old symlink, then set the new one.
+	(remove_symlink): Use rm -f.
+
 	* modules/kernel.eselect (set_symlink):
 	* modules/profile.eselect (set_symlink): Check range of number,
 	bug 617572. Thanks to Takuto Yoshida <otakuto.gentoo@gmail.com>.

diff --git a/modules/kernel.eselect b/modules/kernel.eselect
index e76c143..57b9b7e 100644
--- a/modules/kernel.eselect
+++ b/modules/kernel.eselect
@@ -35,7 +35,7 @@ find_targets() {
 
 # remove the kernel symlink
 remove_symlink() {
-	rm "${EROOT}/usr/src/linux"
+	rm -f "${EROOT}/usr/src/linux"
 }
 
 # set the kernel symlink
@@ -49,15 +49,19 @@ set_symlink() {
 		target=${targets[target-1]}
 	fi
 
-	if [[ -z ${target} ]]; then
-		die -q "Target \"$1\" doesn't appear to be valid!"
-	elif [[ -f ${EROOT}/usr/src/${target}/Makefile ]]; then
-		ln -s "${target}" "${EROOT}/usr/src/linux"
-	elif [[ -f ${EROOT}/usr/src/linux-${target}/Makefile ]]; then
-		ln -s "linux-${target}" "${EROOT}/usr/src/linux"
-	else
-		die -q "Target \"$1\" doesn't appear to be valid!"
+	if [[ -n ${target} ]]; then
+		if [[ -f ${EROOT}/usr/src/${target}/Makefile ]]; then
+			:
+		elif [[ -f ${EROOT}/usr/src/linux-${target}/Makefile ]]; then
+			target=linux-${target}
+		else					# target not valid
+			target=
+		fi
 	fi
+	[[ -n ${target} ]] || die -q "Target \"$1\" doesn't appear to be valid!"
+
+	remove_symlink || die -q "Couldn't remove existing symlink"
+	ln -s "${target}" "${EROOT}/usr/src/linux"
 }
 
 ### show action ###
@@ -114,14 +118,10 @@ do_set() {
 	[[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to"
 	[[ $# -gt 1 ]] && die -q "Too many parameters"
 
-	if [[ -L ${EROOT}/usr/src/linux ]]; then
-		# existing symlink
-		remove_symlink || die -q "Couldn't remove existing symlink"
-		set_symlink "$1" || die -q "Couldn't set a new symlink"
-	elif [[ -e ${EROOT}/usr/src/linux ]]; then
+	if [[ -e ${EROOT}/usr/src/linux && ! -L ${EROOT}/usr/src/linux ]]; then
 		# we have something strange
 		die -q "${EROOT}/usr/src/linux exists but is not a symlink"
-	else
-		set_symlink "$1" || die -q "Couldn't set a new symlink"
 	fi
+
+	set_symlink "$1" || die -q "Couldn't set a new symlink"
 }


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2016-12-06  7:05 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2016-12-06  7:05 UTC (permalink / raw
  To: gentoo-commits

commit:     24b7b6c3026e62b519922cf81074594fbd573ef8
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 05:38:54 2016 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 12:22:01 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=24b7b6c3

Check return status of package manager calls in news module.

* modules/news.eselect (find_items, find_repo_dir): Check return
status of package manager calls, bug 601506.

 ChangeLog            | 5 +++++
 modules/news.eselect | 8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 80bc483..4d12473 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-04  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/news.eselect (find_items, find_repo_dir): Check return
+	status of package manager calls, bug 601506.
+
 2016-10-31  Ulrich Müller  <ulm@gentoo.org>
 
 	* libs/core.bash.in (eval): Disable eval again, because the

diff --git a/modules/news.eselect b/modules/news.eselect
index e413706..1c6a981 100644
--- a/modules/news.eselect
+++ b/modules/news.eselect
@@ -14,7 +14,10 @@ NEWS_DIR="/var/lib/gentoo/news"
 # returns one item per line: status/repository/name
 # sort order: by item name (i.e. effectively by date)
 find_items() {
-	local stat repos=$(get_repositories) repo file item
+	local stat repos repo file item
+	repos=$(get_repositories) \
+		|| die "Package manager cannot get list of repositories"
+	[[ -n ${repos} ]] || write_warning_msg "No repositories found"
 	for stat; do
 		for repo in ${repos}; do
 			file="${EROOT}${NEWS_DIR}/news-${repo}.${stat}"
@@ -80,7 +83,8 @@ find_repo_dir() {
 	done
 	if [[ ${i} -eq ${#repos[@]} ]]; then
 		repos[i]=${repo}
-		dirs[i]=$(get_repo_news_dir "${repo}")
+		dirs[i]=$(get_repo_news_dir "${repo}") \
+			|| die "Package manager cannot get news dir for repo ${repo}"
 	fi
 	dir=${dirs[i]}
 }


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2015-01-18 22:01 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2015-01-18 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     ea8d129841a767d4725c513531b087f8325103bb
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 18 21:59:52 2015 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jan 18 21:59:52 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=ea8d1298

Improve is_script test in rc module.

* modules/rc.eselect (is_script): Don't call external programs.
Test if script is executable, with a shebang in its first line.

---
 ChangeLog          |  3 +++
 modules/rc.eselect | 11 ++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 22cab2a..e8d41ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-01-18  Ulrich Müller  <ulm@gentoo.org>
 
+	* modules/rc.eselect (is_script): Don't call external programs.
+	Test if script is executable, with a shebang in its first line.
+
 	* configure.ac (EXTRAVERSION): Use "git describe --long".
 
 2015-01-17  Ulrich Müller  <ulm@gentoo.org>

diff --git a/modules/rc.eselect b/modules/rc.eselect
index 2a9bf5b..c568a13 100644
--- a/modules/rc.eselect
+++ b/modules/rc.eselect
@@ -32,12 +32,13 @@ list_runlevels() {
 # is_script PRIVATE
 # check if file $1 is a valid init script
 is_script() {
-	local file=${1}
+	local file=$1 line
 	[[ -n ${file} \
-		&& ${file%%.sh} = ${file} \
-		&& ${file%%\~} = ${file} \
-		&& -e ${file} ]] \
-		&& grep '^#!.*/\(runscript\|openrc-run\)' "${file}" &>/dev/null
+			 && ${file%%.sh} = "${file}" \
+			 && ${file%%\~} = "${file}" \
+			 && -x ${file} ]] \
+		&& read line <"${file}" \
+		&& [[ ${line} =~ ^#!.*(runscript|openrc-run) ]]
 }
 
 # find_scripts PRIVATE


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2014-08-28 13:02 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2014-08-28 13:02 UTC (permalink / raw
  To: gentoo-commits

commit:     2595c33ecfc5d1604a421f420ca6786c98968ba8
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 28 13:02:04 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Aug 28 13:02:04 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=2595c33e

Changed heuristic for recognising kernel source trees.

* modules/kernel.eselect (find_targets): Changed heuristic for
recognising kernel source trees: Check for both Makefile and
Kconfig being present, but don't require digits in the directory
name any more. Bug 516754.

---
 ChangeLog              | 5 +++++
 modules/kernel.eselect | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 92d7730..ca4c7c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2014-08-28  Ulrich Müller  <ulm@gentoo.org>
 
+	* modules/kernel.eselect (find_targets): Changed heuristic for
+	recognising kernel source trees: Check for both Makefile and
+	Kconfig being present, but don't require digits in the directory
+	name any more. Bug 516754.
+
 	* libs/core.bash.in (inherit):
 	* libs/tests.bash.in (has):
 	* modules/config.eselect (generic_handle_one_file, accept_handler)

diff --git a/modules/kernel.eselect b/modules/kernel.eselect
index d21b748..c327f3c 100644
--- a/modules/kernel.eselect
+++ b/modules/kernel.eselect
@@ -28,8 +28,8 @@ sort_kernel_versions() {
 # find a list of kernel symlink targets
 find_targets() {
 	local f
-	for f in "${EROOT}"/usr/src/linux-[[:digit:]]*; do
-		[[ -f ${f}/Makefile ]] && basename "${f}"
+	for f in "${EROOT}"/usr/src/linux-*; do
+		[[ -f ${f}/Makefile && -f ${f}/Kconfig ]] && basename "${f}"
 	done | sort_kernel_versions
 }
 


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2014-05-24  7:02 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2014-05-24  7:02 UTC (permalink / raw
  To: gentoo-commits

commit:     4c3a9faded0b5cdce7bac51069759ae23dfa859f
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat May 24 07:02:04 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat May 24 07:02:04 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=4c3a9fad

Fix bash 4.3 breakage.

* modules/profile.eselect (get_repos): Fix bash 4.3 breakage,
bug 511132.

---
 ChangeLog               | 5 +++++
 modules/profile.eselect | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d9dd9fd..b7f4a0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-24  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/profile.eselect (get_repos): Fix bash 4.3 breakage,
+	bug 511132.
+
 2014-05-20  Ulrich Müller  <ulm@gentoo.org>
 
 	* bin/Makefile.am (dosed):

diff --git a/modules/profile.eselect b/modules/profile.eselect
index 3bd5408..94aed2b 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -33,7 +33,7 @@ get_repos() {
 	portageq get_repos "${EROOT:-/}" \
 		| sed "s/[[:space:]]\+/\n/g;s/^${DEFAULT_REPO}\$/ &/gm" \
 		| LC_ALL=C sort
-	[[ -z ${PIPESTATUS[@]#0} ]]
+	[[ "${PIPESTATUS[*]}" = "0 0 0" ]]
 }
 
 # get paths for a given list of repositories


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2014-02-25 10:09 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2014-02-25 10:09 UTC (permalink / raw
  To: gentoo-commits

commit:     7aaf43b23a0b9bc0bb4a2e726bda344409233176
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 25 10:10:55 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Feb 25 10:10:55 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=7aaf43b2

Suppress C and POSIX as languages in news module; support _<territory>.

* modules/news.eselect (accepted_languages): Suppress "C"
and "POSIX" in output. Support <language>_<territory>.

---
 ChangeLog            |  5 +++++
 modules/news.eselect | 11 ++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0c7a8cd..6aad604 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-25  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/news.eselect (accepted_languages): Suppress "C"
+	and "POSIX" in output. Support <language>_<territory>.
+
 2014-02-18  Ulrich Müller  <ulm@gentoo.org>
 
 	* man/news.eselect.5: Update URI of GLEP 42.

diff --git a/modules/news.eselect b/modules/news.eselect
index 463cbbc..782f81c 100644
--- a/modules/news.eselect
+++ b/modules/news.eselect
@@ -87,9 +87,14 @@ find_repo_dir() {
 
 # return list of accepted languages
 accepted_languages() {
-	local lc=${LC_ALL:-${LANG}}
-	lc=${lc%%[^[:alpha:]]*}
-	[[ -n ${lc} && ${lc} != en ]] && echo ${lc}
+	local lc lct=${LC_ALL:-${LANG}}
+	lct=${lct%%[^[:alpha:]_]*}	# strip .* @* etc.
+	lc=${lct%%_*}				# strip _<territory>
+	[[ ${lct} != "${lc}" ]] && echo "${lct}"
+	case ${lc} in
+		""|C|POSIX|en) ;;
+		*) echo "${lc}" ;;
+	esac
 	echo en
 }
 


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2014-02-09 17:57 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2014-02-09 17:57 UTC (permalink / raw
  To: gentoo-commits

commit:     793813aedeea3aa4e9da86e45f703e910a56be86
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 17:59:22 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Feb  9 17:59:22 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=793813ae

Set PATH to service_* commands in rc module.

* modules/rc.eselect (show_script_status): Set proper PATH to service_*
commands.

---
 ChangeLog          | 1 +
 modules/rc.eselect | 1 +
 2 files changed, 2 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index a4cec21..c9d20fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 	Remove baselayout-1 compatibility code.
 	(source_rc_functions): Remove function.
 	(do_show): Don't call source_rc_functions.
+	(show_script_status): Set proper PATH to service_* commands.
 
 2014-01-19  Ulrich Müller  <ulm@gentoo.org>
 

diff --git a/modules/rc.eselect b/modules/rc.eselect
index dc8b0d5..f02abf7 100644
--- a/modules/rc.eselect
+++ b/modules/rc.eselect
@@ -64,6 +64,7 @@ find_unused_scripts() {
 # output list entry for script $1 and show its status
 show_script_status() {
 	local script=${1} status=unknown x
+	local PATH=/lib/rc/bin:${PATH} # path to service_* commands
 
 	for x in stopping starting inactive started stopped; do
 		if service_${x} ${script}; then


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2014-02-09 16:23 Ulrich Müller
  2014-02-09 17:57 ` Ulrich Müller
  0 siblings, 1 reply; 25+ messages in thread
From: Ulrich Müller @ 2014-02-09 16:23 UTC (permalink / raw
  To: gentoo-commits

commit:     38614e63db2a5a124bc5971309c80c5c9533770e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 16:25:45 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Feb  9 16:25:45 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=38614e63

Do not source functions.sh in rc module, bug 373219.

* modules/rc.eselect (get_runlevel): Call "rc-status -r" directly,
in order to avoid sourcing functions.sh, bug 373219.
Remove baselayout-1 compatibility code.
(source_rc_functions): Remove function.
(do_show): Don't call source_rc_functions.

---
 ChangeLog          |  8 ++++++++
 modules/rc.eselect | 17 ++---------------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 61e7e66..a4cec21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-02-09  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/rc.eselect (get_runlevel): Call "rc-status -r" directly,
+	in order to avoid sourcing functions.sh, bug 373219.
+	Remove baselayout-1 compatibility code.
+	(source_rc_functions): Remove function.
+	(do_show): Don't call source_rc_functions.
+
 2014-01-19  Ulrich Müller  <ulm@gentoo.org>
 
 	* libs/package-manager.bash.in (arch): Recognise aarch64*/arm64.

diff --git a/modules/rc.eselect b/modules/rc.eselect
index a661445..dc8b0d5 100644
--- a/modules/rc.eselect
+++ b/modules/rc.eselect
@@ -7,22 +7,11 @@ inherit config
 DESCRIPTION="Manage /etc/init.d scripts in runlevels"
 MAINTAINER="eselect@gentoo.org"
 
-# source_rc_functions PRIVATE
-# API for OpenRC
-source_rc_functions() {
-	[[ ${RC_GOT_FUNCTIONS} = yes ]] && return
-	source "${EPREFIX}/etc/init.d/functions.sh" \
-		|| die "Failed to source functions.sh"
-}
-
 # get_runlevel PRIVATE
 # determine the current runlevel
-# this is only functional if source_rc_functions has been called before
 get_runlevel() {
-	if type rc_runlevel &>/dev/null; then
-		rc_runlevel || die "rc_runlevel failed"
-	elif [[ -n ${SOFTLEVEL} ]]; then
-		echo "${SOFTLEVEL}"
+	if type rc-status &>/dev/null; then
+		rc-status -r || die "rc_status failed"
 	else
 		die "Cannot determine runlevel"
 	fi
@@ -240,8 +229,6 @@ describe_show_options() {
 do_show() {
 	local runlevel all unused n x
 
-	source_rc_functions
-
 	if [[ $# -eq 0 ]]; then
 		set -- "$(get_runlevel)"
 	else


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2013-11-14 16:47 Ulrich Müller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Müller @ 2013-11-14 16:47 UTC (permalink / raw
  To: gentoo-commits

commit:     e85c43aa6c5aba6d17b509065306c72fae42485e
Author:     Michael Marineau <mike <AT> marineau <DOT> org>
AuthorDate: Thu Nov 14 01:55:18 2013 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Nov 14 11:49:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=e85c43aa

Silence profile symlink warning when using --force, bug 491216.

When building packages in an alternate ROOT that doesn't need to be
perfectly configured as a stand-alone system it is reasonable for
PORTDIR to be shared with the host system and not inside of ROOT. Also
when using eselect in automated scripts (to take advantage of
repo_name:foo/profile/path parsing) it feels clunky to have to emit
"Please ignore the following warning" messages to avoid scaring people.

---
 ChangeLog               | 5 +++++
 modules/profile.eselect | 1 +
 2 files changed, 6 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 31418dd..89fe111 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-14  Michael Marineau  <mike@marineau.org>
+
+	* modules/profile.eselect (set_symlink): Silence profile symlink
+	warning when using --force, bug 491216.
+
 2013-11-10  Ulrich Müller  <ulm@gentoo.org>
 
 	* libs/output.bash.in (space): Implement more efficiently.

diff --git a/modules/profile.eselect b/modules/profile.eselect
index a91a45f..77533ea 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -122,6 +122,7 @@ set_symlink() {
 		|| die -q "Couldn't set new ${MAKE_PROFILE} symlink"
 	# check if the resulting symlink is sane
 	[[ $(canonicalise "${MAKE_PROFILE}") != "$(canonicalise "${EROOT}")"/* ]] \
+		&& [[ -z ${force} ]] \
 		&& write_warning_msg "Strange path. Check ${MAKE_PROFILE} symlink"
 
 	return 0


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2013-08-24 16:52 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2013-08-24 16:52 UTC (permalink / raw
  To: gentoo-commits

commit:     2e050fa70b6ffdd25698796ea9166893f623d605
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 24 16:51:17 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Aug 24 16:51:17 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=2e050fa7

Drop baselayout-1 compatibility code.

* modules/rc.eselect (source_rc_functions): Drop baselayout-1
compatibility code.

---
 ChangeLog          | 5 +++++
 modules/rc.eselect | 7 +------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f5883ce..0192116 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-24  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/rc.eselect (source_rc_functions): Drop baselayout-1
+	compatibility code.
+
 2013-08-08  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Check whether we are building from git;

diff --git a/modules/rc.eselect b/modules/rc.eselect
index c9f4b8b..dc59ee2 100644
--- a/modules/rc.eselect
+++ b/modules/rc.eselect
@@ -8,16 +8,11 @@ DESCRIPTION="Manage /etc/init.d scripts in runlevels"
 MAINTAINER="eselect@gentoo.org"
 
 # source_rc_functions PRIVATE
-# API for OpenRC or baselayout-1
+# API for OpenRC
 source_rc_functions() {
 	[[ ${RC_GOT_FUNCTIONS} = yes ]] && return
 	source "${EPREFIX}/etc/init.d/functions.sh" \
 		|| die "Failed to source functions.sh"
-	# baselayout-1 compatibility
-	if [[ -e ${svclib}/sh/rc-services.sh ]]; then
-		source "${svclib}/sh/rc-services.sh" \
-			|| die "Failed to source rc-services.sh"
-	fi
 }
 
 # get_runlevel PRIVATE


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2013-07-16 14:27 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2013-07-16 14:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2ea27fd3794db4758c2f76117f34d6205652ce2b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 15:41:00 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Jul 16 07:45:30 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=2ea27fd3

Remove bashcomp module, bug 476992.

* modules/bashcomp.eselect: Remove.
* modules/Makefile.am (modules_DATA): Remove bashcomp.eselect.
* Makefile.am (symlinks): Don't install bashcomp-config symlink.

---
 AUTHORS                  |   2 +-
 ChangeLog                |   6 ++
 Makefile.am              |   2 +-
 modules/Makefile.am      |   1 -
 modules/bashcomp.eselect | 207 -----------------------------------------------
 5 files changed, 8 insertions(+), 210 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 4bb8e85..5246168 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -9,7 +9,7 @@ Danny van Dyk <kugelfang@gentoo.org>
     Libraries:  config, multilib
 
 Aaron Walker <ka0ttic@gentoo.org>
-    Modules:    bashcomp, profile
+    Modules:    profile
 
 Donnie Berkholz <dberkholz@gentoo.org>
     Libraries:  skel

diff --git a/ChangeLog b/ChangeLog
index 827532d..67605fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-16  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/bashcomp.eselect: Remove, bug 476992.
+	* modules/Makefile.am (modules_DATA): Remove bashcomp.eselect.
+	* Makefile.am (symlinks): Don't install bashcomp-config symlink.
+
 2013-07-14  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/kernel.eselect (find_targets, set_symlink, do_show):

diff --git a/Makefile.am b/Makefile.am
index e7a0972..ead15e5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = dist-xz no-dist-gzip
 
 doc_files = README TODO
-export symlinks := kernel-config profile-config rc-config bashcomp-config
+export symlinks := kernel-config profile-config rc-config
 
 SUBDIRS = doc man misc bin libs modules
 MAINTAINERCLEANFILES = \

diff --git a/modules/Makefile.am b/modules/Makefile.am
index db6857b..73960c4 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1,7 +1,6 @@
 modulesdir=$(datadir)/$(PACKAGE_NAME)/modules/
 
 modules_DATA = \
-	bashcomp.eselect \
 	binutils.eselect \
 	editor.eselect \
 	env.eselect \

diff --git a/modules/bashcomp.eselect b/modules/bashcomp.eselect
deleted file mode 100644
index d837b67..0000000
--- a/modules/bashcomp.eselect
+++ /dev/null
@@ -1,207 +0,0 @@
-# -*-eselect-*-  vim: ft=eselect
-# Copyright 2005-2013 Gentoo Foundation
-# Distributed under the terms of the GNU GPL version 2 or later
-
-DESCRIPTION="Manage contributed bash-completion scripts"
-MAINTAINER="eselect@gentoo.org"
-
-find_targets() {
-	local bcdir bc
-
-	for bcdir in "${EROOT%/}/usr/share/bash-completion" ${ES_BASHCOMP_DIRS}
-	do
-		for bc in "${bcdir}"/*; do
-			[[ -f ${bc} && ${bc} != *~ ]] && basename "${bc}"
-		done
-	done | sort -u
-}
-
-is_enabled() {
-	local bcdir
-
-	bcdir=${ROOT%/}/${HOME}/.bash_completion.d
-	if [[ $1 == "--global" ]]; then
-		bcdir=${EROOT%/}/etc/bash_completion.d
-		shift
-	fi
-
-	[[ -e ${bcdir}/$1 ]]
-}
-
-### list action ###
-
-describe_list() {
-	echo "List available completions"
-}
-
-describe_list_options() {
-	echo "--global : List globally enabled completions"
-}
-
-do_list() {
-	local targets opts i
-	targets=( $(find_targets) )
-
-	if [[ $1 == "--global" ]]; then
-		opts="--global"
-		shift
-	fi
-
-	for (( i = 0; i < ${#targets[@]}; i++ )); do
-		is_enabled ${opts} "${targets[i]}" \
-			&& targets[i]=$(highlight_marker "${targets[i]}")
-	done
-
-	write_list_start "Available completions:"
-	write_numbered_list -m "(none found)" "${targets[@]}"
-}
-
-### enable action ###
-
-describe_enable() {
-	echo "Enable specified completion(s)"
-}
-
-describe_enable_parameters() {
-	echo "<target>"
-}
-
-describe_enable_options() {
-	echo "--global : Enable for all users"
-	echo "<target> : Target name or number (from 'list' action)"
-}
-
-do_enable() {
-	local bcdir bc mode="" file target targets
-
-	bcdir=${ROOT%/}/${HOME}/.bash_completion.d
-	if [[ $1 == "--global" ]]; then
-		bcdir=${EROOT%/}/etc/bash_completion.d
-		mode="-m 0755"
-		shift
-	fi
-
-	[[ $# -eq 0 ]] && die -q "You didn't specify any completions to enable."
-
-	# create directory if necessary
-	if [[ ! -d ${bcdir} && -w $(dirname ${bcdir}) ]]; then
-		mkdir ${mode} "${bcdir}" || die -q "Failed to create ${bcdir}"
-	elif [[ ! -d ${bcdir} ]]; then
-		die -q "You don't have permission to create ${bcdir}"
-	fi
-
-	# make sure we have proper permissions
-	[[ -w ${bcdir} ]] \
-		|| die -q "You don't have permission to write to ${bcdir}"
-
-	targets=( $(find_targets) )
-
-	for bc in "$@"; do
-		# ignore any unrecognized options
-		[[ ${bc} == --* ]] && continue
-
-		target=${bc}
-		is_number "${target}" && target=${targets[target-1]}
-
-		[[ -z ${target} ]] \
-			&& die -q "Target \"${bc}\" doesn't appear to be valid!"
-
-		bc=${target}
-
-		# what form is the argument in?
-		case "${bc}" in
-			# absolute path
-			/*)
-				file=${ROOT%/}/${bc}
-				;;
-			# relative path
-			*/*)
-				file=${ROOT%/}/${PWD}/${bc}
-				;;
-			# no path
-			*)
-				# assume /usr/share/bash-completion
-				file=${EROOT%/}/usr/share/bash-completion/${bc}
-				if [[ ! -f ${file} ]]; then
-					for x in ${ES_BASHCOMP_DIRS}; do
-						[[ -f ${x}/${bc} ]] && file=${x}/${bc}
-					done
-				fi
-				;;
-		esac
-
-		# does it exist?
-		if [[ ! -f ${file} ]]; then
-			write_error_msg "${file} doesn't exist"
-			continue
-		fi
-
-		# already installed?
-		if [[ -e ${bcdir}/$(basename ${bc}) ]]; then
-			write_error_msg "$(basename ${bc}) is already installed"
-			continue
-		fi
-
-		# finally, create the symlink
-		ln -s "$(relative_name "${file}" "${bcdir}")" "${bcdir}/" \
-			|| die -q "Failed to create symlink from ${file} to ${bcdir}"
-	done
-}
-
-### disable action ###
-
-describe_disable() {
-	echo "Disable specified completion(s)"
-}
-
-describe_disable_parameters() {
-	echo "<target>"
-}
-
-describe_disable_options() {
-	echo "--global : Disable for all users"
-	echo "<target> : Target name or number (from 'list' action)"
-}
-
-
-do_disable() {
-	local bcdir bc targets target file
-
-	bcdir=${ROOT%/}/${HOME}/.bash_completion.d
-	if [[ $1 == "--global" ]]; then
-		bcdir=${EROOT%/}/etc/bash_completion.d
-		shift
-	fi
-
-	[[ $# -eq 0 ]] && die -q "You didn't specify any completions to disable"
-
-	targets=( $(find_targets) )
-
-	for bc in "$@"; do
-		# ignore any unrecognized options
-		[[ ${bc} == --* ]] && continue
-
-		target=${bc}
-
-		is_number "${target}" && target=${targets[target-1]}
-
-		[[ -z ${target} ]] \
-			&& die -q "Target \"${bc}\" doesn't appear to be valid!"
-
-		bc=${target}
-		file=${bcdir}/${bc}
-
-		# is it installed?
-		if [[ ! -e ${file} ]]; then
-			write_error_msg "${bc} is not installed"
-			continue
-		fi
-
-		# remove it if we have permissions
-		if [[ -w $(dirname ${file}) ]]; then
-			rm "${file}" || die -q "Failed to remove ${file}"
-		else
-			die -q "You don't have permission to remove ${file}"
-		fi
-	done
-}


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2013-07-14 15:24 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2013-07-14 15:24 UTC (permalink / raw
  To: gentoo-commits

commit:     fb4af551582bbc588e9a97fdb0af942126b618c9
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 14 15:18:25 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jul 14 15:18:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=fb4af551

kernel.eselect: Check for Makefile in target tree, bug 460328.

* modules/kernel.eselect (find_targets, set_symlink, do_show):
Consider target trees as valid only if they contain a Makefile,
bug 460328. Thanks to C.J. Wijtmans <cj.wijtmans <AT> gmail.com>.

---
 ChangeLog              | 6 ++++++
 modules/kernel.eselect | 8 +++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ab9fdc2..827532d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-14  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/kernel.eselect (find_targets, set_symlink, do_show):
+	Consider target trees as valid only if they contain a Makefile,
+	bug 460328. Thanks to C.J. Wijtmans <cj.wijtmans@gmail.com>.
+
 2013-07-11  Ulrich Müller  <ulm@gentoo.org>
 
 	* doc/user-guide.txt:

diff --git a/modules/kernel.eselect b/modules/kernel.eselect
index f6778b8..87045f8 100644
--- a/modules/kernel.eselect
+++ b/modules/kernel.eselect
@@ -29,7 +29,7 @@ sort_kernel_versions() {
 find_targets() {
 	local f
 	for f in "${EROOT}"/usr/src/linux-[[:digit:]]*; do
-		[[ -d ${f} ]] && basename "${f}"
+		[[ -f ${f}/Makefile ]] && basename "${f}"
 	done | sort_kernel_versions
 }
 
@@ -49,9 +49,9 @@ set_symlink() {
 
 	if [[ -z ${target} ]]; then
 		die -q "Target \"$1\" doesn't appear to be valid!"
-	elif [[ -d ${EROOT}/usr/src/${target} ]]; then
+	elif [[ -f ${EROOT}/usr/src/${target}/Makefile ]]; then
 		ln -s "${target}" "${EROOT}/usr/src/linux"
-	elif [[ -d ${EROOT}/usr/src/linux-${target} ]]; then
+	elif [[ -f ${EROOT}/usr/src/linux-${target}/Makefile ]]; then
 		ln -s "linux-${target}" "${EROOT}/usr/src/linux"
 	else
 		die -q "Target \"$1\" doesn't appear to be valid!"
@@ -69,6 +69,8 @@ do_show() {
 	if [[ -L ${EROOT}/usr/src/linux ]]; then
 		local kernel=$(canonicalise "${EROOT}/usr/src/linux")
 		write_kv_list_entry "${kernel%/}" ""
+		[[ -f ${kernel}/Makefile ]] \
+			|| write_warning_msg "Symlink target doesn't appear to be valid!"
 	else
 		write_kv_list_entry "(unset)" ""
 	fi


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2013-02-22 22:24 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2013-02-22 22:24 UTC (permalink / raw
  To: gentoo-commits

commit:     08510d6b16fac8724371c87e788327c2a8418bac
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 22 22:27:54 2013 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Feb 22 22:27:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=08510d6b

Honour PORTAGE_CONFIGROOT in profile module, bug 453006.

* modules/profile.eselect (get_symlink_location):
Create profile symlink below PORTAGE_CONFIGROOT, bug 453006.

---
 ChangeLog               |    5 +++++
 modules/profile.eselect |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c24a5fb..e6ee7e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-22  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/profile.eselect (get_symlink_location):
+	Create profile symlink below PORTAGE_CONFIGROOT, bug 453006.
+
 2013-01-13  Ulrich Müller  <ulm@gentoo.org>
 
 	* bin/eselect.in (ESELECT_STDERR): Save stderr file descriptor.

diff --git a/modules/profile.eselect b/modules/profile.eselect
index 5f06130..a91a45f 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -12,8 +12,9 @@ DEFAULT_REPO="gentoo"
 
 # get location of make.profile symlink
 get_symlink_location() {
-	local oldloc=${EROOT%/}/etc/make.profile
-	local newloc=${EROOT%/}/etc/portage/make.profile
+	local root=${PORTAGE_CONFIGROOT-${EROOT}}
+	local oldloc=${root%/}/etc/make.profile
+	local newloc=${root%/}/etc/portage/make.profile
 
 	MAKE_PROFILE=${newloc}
 	if [[ -e ${oldloc} ]]; then


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2012-12-06 21:02 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-12-06 21:02 UTC (permalink / raw
  To: gentoo-commits

commit:     ee66576015a6dc576e76ac1539412ec32ba466d9
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  6 21:02:55 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Dec  6 21:02:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=ee665760

Use EROOT in profile module to make it work in Prefix, bug 444620.

* modules/profile.eselect (get_repos, get_repo_path): Use EROOT
to make it work in Prefix, fixes bug 444620. Thanks to Greg Turner
<gmturner007 <AT> ameritech.net> for bug report and patch.

---
 ChangeLog               |    6 ++++++
 modules/profile.eselect |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3cb3db2..af6eb4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-06  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/profile.eselect (get_repos, get_repo_path): Use EROOT
+	to make it work in Prefix, fixes bug 444620. Thanks to Greg Turner
+	<gmturner007@ameritech.net> for bug report and patch.
+
 2012-10-21  Ulrich Müller  <ulm@gentoo.org>
 
 	* configure.ac: Update version to 1.3.3.

diff --git a/modules/profile.eselect b/modules/profile.eselect
index 6db3dd5..4d21cd1 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -29,7 +29,7 @@ get_symlink_location() {
 # get list of repositories
 get_repos() {
 	# sort: DEFAULT_REPO first, then alphabetical order
-	portageq get_repos "${ROOT:-/}" \
+	portageq get_repos "${EROOT:-/}" \
 		| sed "s/[[:space:]]\+/\n/g;s/^${DEFAULT_REPO}\$/ &/gm" \
 		| LC_ALL=C sort
 	[[ -z ${PIPESTATUS[@]#0} ]]
@@ -37,7 +37,7 @@ get_repos() {
 
 # get paths for a given list of repositories
 get_repo_path() {
-	portageq get_repo_path "${ROOT:-/}" "$@"
+	portageq get_repo_path "${EROOT:-/}" "$@"
 }
 
 # get a list of valid profiles


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2012-09-12 22:09 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-09-12 22:09 UTC (permalink / raw
  To: gentoo-commits

commit:     faa7f7a2e573c1484a53aa9148683b1c41152730
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 12 22:06:54 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Sep 12 22:06:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=faa7f7a2

Prefer /etc/portage/make.profile.

* modules/profile.eselect (get_symlink_location): When both
/etc/make.profile and /etc/portage/make.profile exist, prefer the
latter. This follows the change of the default location in Portage
and in stages.

---
 ChangeLog               |    7 +++++++
 modules/profile.eselect |    6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2c98618..d031f48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-12  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/profile.eselect (get_symlink_location): When both
+	/etc/make.profile and /etc/portage/make.profile exist, prefer the
+	latter. This follows the change of the default location in Portage
+	and in stages.
+
 2012-08-19  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/binutils.eselect (switch_profile): Fix typo in

diff --git a/modules/profile.eselect b/modules/profile.eselect
index d0acdf7..39794d9 100644
--- a/modules/profile.eselect
+++ b/modules/profile.eselect
@@ -15,14 +15,14 @@ get_symlink_location() {
 	local oldloc=${EROOT%/}/etc/make.profile
 	local newloc=${EROOT%/}/etc/portage/make.profile
 
+	MAKE_PROFILE=${newloc}
 	if [[ -e ${oldloc} ]]; then
-		MAKE_PROFILE=${oldloc}
 		if [[ -e ${newloc} ]]; then
 			write_warning_msg "Both ${oldloc} and ${newloc} exist."
 			write_warning_msg "Using ${MAKE_PROFILE} for now."
+		else
+			MAKE_PROFILE=${oldloc}
 		fi
-	else
-		MAKE_PROFILE=${newloc}
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2012-08-19 20:03 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-08-19 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e0534bb01ed5ef31170539f3d51929a14619ff1a
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 19 19:13:27 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Aug 19 19:13:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=e0534bb0

Fix typo in binutils module, bug 431898.

* modules/binutils.eselect (switch_profile): Fix typo in
data path, bug 431898.

---
 ChangeLog                |    5 +++++
 NEWS                     |    1 +
 modules/binutils.eselect |    2 +-
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 968dfa3..2c98618 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-19  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/binutils.eselect (switch_profile): Fix typo in
+	data path, bug 431898.
+
 2012-06-27  Ulrich Müller  <ulm@gentoo.org>
 
 	* modules/binutils.eselect (find_targets): Properly quote

diff --git a/NEWS b/NEWS
index 5e40c13..b135f43 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ ChangeLog file for a more detailed listing of changes/bug fixes.
 
     Bug fixes:
     - Fixed bug #423525: Prevent false globbing in binutils module.
+    - Fixed bug #431898: Fix typo in data path of binutils module.
 
 1.3.1:
     Bug fixes:

diff --git a/modules/binutils.eselect b/modules/binutils.eselect
index fe79723..4107d5f 100644
--- a/modules/binutils.eselect
+++ b/modules/binutils.eselect
@@ -130,7 +130,7 @@ switch_profile() {
 
 	# Update the environment
 	if [[ ${target} == ${chost} ]] ; then
-		datapath=${EPREFIX}/usr/share/binutils-date/${target}/${version}
+		datapath=${EPREFIX}/usr/share/binutils-data/${target}/${version}
 		[[ -d ${datapath}/man ]] \
 			&& store_config ${BINUTILS_ENVFILE} MANPATH "${datapath}/man"
 		[[ -d ${datapath}/info ]] \


^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: /, modules/
@ 2012-06-27 17:02 Ulrich Mueller
  0 siblings, 0 replies; 25+ messages in thread
From: Ulrich Mueller @ 2012-06-27 17:02 UTC (permalink / raw
  To: gentoo-commits

commit:     d1b1a4320db209587216626fa744e6e5fcd0e43d
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 27 17:06:07 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun 27 17:06:07 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=d1b1a432

Properly quote variables to prevent false globbing, bug 423525.

* modules/binutils.eselect (find_targets): Properly quote
variables to prevent false globbing, bug 423525.

---
 ChangeLog                |    5 +++++
 modules/binutils.eselect |   14 +++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index da8bb61..968dfa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-27  Ulrich Müller  <ulm@gentoo.org>
+
+	* modules/binutils.eselect (find_targets): Properly quote
+	variables to prevent false globbing, bug 423525.
+
 2012-03-07  Ulrich Müller  <ulm@gentoo.org>
 
 	* doc/release-guide.txt: Update to reflect the transition from

diff --git a/modules/binutils.eselect b/modules/binutils.eselect
index 6bf0657..8694bd5 100644
--- a/modules/binutils.eselect
+++ b/modules/binutils.eselect
@@ -12,17 +12,17 @@ BINUTILS_ENVFILE=${EROOT}/etc/env.d/05binutils
 # find_targets [patterns]
 # find all possible targets [that match one of ${@}]
 find_targets() {
-	local args=${@} targets
-	[[ -z ${args[@]} ]] && args='-*'
-	for item in ${args} ; do
+	local item targets
+	[[ $# -eq 0 ]] && set -- "-*"
+	for item; do
 		item=${item%%-[1-9]*}
-		[[ ${item:0:1} == '-' ]] || item=-${item}
-		for file in "${EROOT}"/etc/env.d/binutils/config${item} ; do
+		[[ ${item:0:1} == "-" ]] || item=-${item}
+		for file in "${EROOT}"/etc/env.d/binutils/config${item}; do
 			[[ -f ${file} ]] || continue
-			targets=(${targets[@]} "${file##*/config-}")
+			targets=("${targets[@]}" "${file##*/config-}")
 		done
 	done
-	echo ${targets[@]}
+	echo "${targets[@]}"
 }
 
 # find_versions



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

end of thread, other threads:[~2023-08-07 16:22 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 11:27 [gentoo-commits] proj/eselect:master commit in: /, modules/ Ulrich Müller
  -- strict thread matches above, loose matches on Subject: below --
2023-08-07 16:22 Ulrich Müller
2023-06-12 16:24 Ulrich Müller
2019-11-28 13:16 Ulrich Müller
2018-01-24 10:03 Ulrich Müller
2018-01-08 23:30 Ulrich Müller
2017-12-25 11:00 Ulrich Müller
2017-05-06 13:24 Ulrich Müller
2016-12-06  7:05 Ulrich Müller
2015-01-18 22:01 Ulrich Müller
2014-08-28 13:02 Ulrich Müller
2014-05-24  7:02 Ulrich Müller
2014-02-25 10:09 Ulrich Müller
2014-02-09 17:57 Ulrich Müller
2014-02-09 16:23 Ulrich Müller
2014-02-09 17:57 ` Ulrich Müller
2013-11-14 16:47 Ulrich Müller
2013-08-24 16:52 Ulrich Mueller
2013-07-16 14:27 Ulrich Mueller
2013-07-14 15:24 Ulrich Mueller
2013-02-22 22:24 Ulrich Mueller
2012-12-06 21:02 Ulrich Mueller
2012-09-12 22:09 Ulrich Mueller
2012-08-19 20:03 Ulrich Mueller
2012-06-27 17:02 Ulrich Mueller

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