public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/eselect-rust:master commit in: /
Date: Mon, 11 Mar 2019 05:02:45 +0000 (UTC)	[thread overview]
Message-ID: <1552280185.51b5d26d5fddcffc9f89a4e5256c457182bf47c8.whissi@gentoo> (raw)

commit:     51b5d26d5fddcffc9f89a4e5256c457182bf47c8
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 11 03:11:28 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 04:56:25 2019 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=51b5d26d

find_targets(): sort by version

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 rust.eselect.in | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/rust.eselect.in b/rust.eselect.in
index 0ecf87a..311d8c0 100644
--- a/rust.eselect.in
+++ b/rust.eselect.in
@@ -38,12 +38,32 @@ find_missing_broken_symlinks() {
 # in "${ENV_D_PATH}/rust" directory
 # this function prints list of $pkgname-$pkgver values
 find_targets() {
-	local f
+	local f fn
 	local -a providers
+	local -a providers_unsorted
+	local -a providers_sorted
 	for f in "${ENV_D_PATH}"/rust/provider-*; do
 		[[ -f ${f} ]] || continue
-		providers=("${providers[@]}" "${f##*/provider-}")
+		fn="${f##*/provider-}"
+		if [[ "${fn}" == rust-bin-* ]]; then
+			providers_unsorted+=( "${fn##rust-bin-}-mysortA" )
+		elif [[ "${fn}" == rust-* ]]; then
+			providers_unsorted+=( "${fn##rust-}-mysortZ" )
+		else
+			die -q "Unsupported rust provider file '${f}' found."
+		fi
+	done
+
+	IFS=$'\n' LC_COLLATE=C providers_sorted=( $(sort <<<"${providers_unsorted[*]}") )
+
+	for fn in "${providers_sorted[@]}"; do
+		if [[ "${fn}" == *-mysortA ]]; then
+			providers+=( "rust-bin-${fn%%-mysortA}" )
+		else
+			providers+=( "rust-${fn%%-mysortZ}" )
+		fi
 	done
+
 	echo "${providers[@]}"
 }
 


             reply	other threads:[~2019-03-11  5:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  5:02 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-03  7:49 [gentoo-commits] proj/eselect-rust:master commit in: / Georgy Yakovlev
2020-04-19  1:21 Thomas Deutschmann
2020-04-19  1:21 Thomas Deutschmann
2020-04-19  1:21 Thomas Deutschmann
2020-01-01 22:25 Thomas Deutschmann
2020-01-01 22:25 Thomas Deutschmann
2020-01-01 22:05 Thomas Deutschmann
2019-03-11  5:02 Thomas Deutschmann
2019-03-11  5:02 Thomas Deutschmann
2019-03-11  5:02 Thomas Deutschmann
2019-03-11  5:02 Thomas Deutschmann
2019-03-11  5:02 Thomas Deutschmann
2019-03-11  5:02 Thomas Deutschmann

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=1552280185.51b5d26d5fddcffc9f89a4e5256c457182bf47c8.whissi@gentoo \
    --to=whissi@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