public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/eselect:master commit in: /, modules/
Date: Mon,  8 Jan 2018 23:30:14 +0000 (UTC)	[thread overview]
Message-ID: <1515454185.a25b292e4feaab4b3c073eeb1ed96166893e2d2b.ulm@gentoo> (raw)

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[@]}"


             reply	other threads:[~2018-01-09  2:02 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 23:30 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-22  5:55 [gentoo-commits] proj/eselect:master commit in: /, modules/ Ulrich Müller
2024-11-18  5:52 Ulrich Müller
2024-11-13 20:26 Ulrich Müller
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
2017-12-25 11:00 Ulrich Müller
2017-05-22 11:27 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515454185.a25b292e4feaab4b3c073eeb1ed96166893e2d2b.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox