guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id.


From: zimoun
Subject: [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id.
Date: Thu, 20 Oct 2022 15:28:13 +0200

* etc/teams.scm.in (list-teams): Sort teams by id.
---
 etc/teams.scm.in | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 8e18a5d206..3d4c7319c2 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -556,8 +556,8 @@ (define (list-teams)
   "Print all teams, their scope and their members."
   (define port* (current-output-port))
   (define width* (%text-width))
-  (hash-for-each
-   (lambda (key team)
+  (for-each
+   (lambda (team)
      (format port*
              "\
 id: ~a
@@ -584,7 +584,11 @@ (define width* (%text-width))
                                string<=?)))))
      (list-members team port* "+ ")
      (newline))
-   %teams))
+   (sort
+    (hash-map->list (lambda (key value) value) %teams)
+    (lambda (team1 team2)
+      (string<? (symbol->string (team-id team1))
+                (symbol->string (team-id team2)))))))
 
 
 (define (diff-revisions rev-start rev-end)
-- 
2.36.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]