From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0161D138330 for ; Tue, 9 Jan 2018 02:02:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C39DE09BA; Tue, 9 Jan 2018 02:00:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 23078E09A8 for ; Tue, 9 Jan 2018 02:00:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9982C335C74 for ; Mon, 8 Jan 2018 23:30:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2C653151 for ; Mon, 8 Jan 2018 23:30:14 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1515454185.a25b292e4feaab4b3c073eeb1ed96166893e2d2b.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: /, modules/ X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog modules/profile.eselect X-VCS-Directories: modules/ / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: a25b292e4feaab4b3c073eeb1ed96166893e2d2b X-VCS-Branch: master Date: Mon, 8 Jan 2018 23:30:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 894f665d-782e-4812-a48a-e9804985a71d X-Archives-Hash: 79723e0ee007eb61d628678e884f9d36 commit: a25b292e4feaab4b3c073eeb1ed96166893e2d2b Author: Ulrich Müller gentoo org> AuthorDate: Mon Jan 8 23:29:45 2018 +0000 Commit: Ulrich Müller gentoo 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 + + * 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 * 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 :::: for every profile +# returns a line :::::: 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[@]}"