unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58660] [PATCH 1/4] etc: teams: Improve scope display.
       [not found] <20221020132140.1546684-1-zimon.toutoune@gmail.com>
@ 2022-10-20 13:28 ` zimoun
  2022-10-20 13:28   ` [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id zimoun
                     ` (2 more replies)
  2022-11-04 10:11 ` [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm zimoun
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 18+ messages in thread
From: zimoun @ 2022-10-20 13:28 UTC (permalink / raw)
  To: 58660; +Cc: zimoun

* etc/teams.scm.in (<regexp*>): New record type.
(make-regexp*, regexp-exec*): New procedures.
(python, haskell, julia, java, emacs, rust, core, translations, installer,
home): Use it.
(find-team-by-scope): Use it.
(list-teams): Use it and sort scope files.
---
 etc/teams.scm.in | 62 ++++++++++++++++++++++++++++++++++--------------
 1 file changed, 44 insertions(+), 18 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index c27ea5271e..394e4d7d46 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,6 +5,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -37,6 +38,25 @@
              (guix ui)
              (git))
 
+;;; Work around regexp implementation.
+;;; This record allows to track the regexp pattern and then display it.
+(define-record-type <regexp*>
+  (regexp* pat flag)
+  regexp*?
+  (pat regexp-pattern*)
+  (flag regexp-flag*))
+
+(define* (make-regexp* pat #:optional flag)
+  (regexp* pat flag))
+
+(define (regexp-exec* rx* str)
+  (let ((rx (make-regexp
+             (regexp-pattern* rx*)
+             (or (regexp-flag* rx*)
+                 regexp/extended))))
+    (regexp-exec rx str)))
+
+\f
 (define-record-type <team>
   (make-team id name description members scope)
   team?
@@ -97,7 +117,7 @@ (define-team python
         (list "gnu/packages/django.scm"
               "gnu/packages/jupyter.scm"
               ;; Match haskell.scm and haskell-*.scm.
-              (make-regexp "^gnu/packages/python(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/python(-.+|)\\.scm$")
               "gnu/packages/sphinx.scm"
               "gnu/packages/tryton.scm"
               "guix/build/python-build-system.scm"
@@ -115,7 +135,7 @@ (define-team haskell
         #:scope
         (list "gnu/packages/dhall.scm"
               ;; Match haskell.scm and haskell-*.scm.
-              (make-regexp "^gnu/packages/haskell(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/haskell(-.+|)\\.scm$")
               "gnu/packages/purescript.scm"
               "guix/build/haskell-build-system.scm"
               "guix/build-system/haskell.scm"
@@ -143,7 +163,7 @@ (define-team julia
         #:name "Julia team"
         #:description
         "The Julia language, Julia packages, and the julia-build-system."
-        #:scope (list (make-regexp "^gnu/packages/julia(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/julia(-.+|)\\.scm$")
                       "guix/build/julia-build-system.scm"
                       "guix/build-system/julia.scm")))
 
@@ -172,14 +192,14 @@ (define-team java
 and the maven-build-system."
         #:scope
         (list ;; Match java.scm and java-*.scm.
-              (make-regexp "^gnu/packages/java(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/java(-.+|)\\.scm$")
               ;; Match maven.scm and maven-*.scm
-              (make-regexp "^gnu/packages/maven(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/maven(-.+|)\\.scm$")
               "guix/build/ant-build-system.scm"
               "guix/build/java-utils.scm"
               "guix/build/maven-build-system.scm"
               ;; The maven directory
-              (make-regexp "^guix/build/maven/")
+              (make-regexp* "^guix/build/maven/")
               "guix/build-system/ant.scm"
               "guix/build-system/maven.scm")))
 
@@ -192,7 +212,7 @@ (define-team emacs
         #:name "Emacs team"
         #:description "The extensible, customizable text editor and its
 ecosystem."
-        #:scope (list (make-regexp "^gnu/packages/emacs(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/emacs(-.+|)\\.scm$")
                       "guix/build/emacs-build-system.scm"
                       "guix/build/emacs-utils.scm"
                       "guix/build-system/emacs.scm"
@@ -206,7 +226,7 @@ (define-team lisp
         #:description
         "Common Lisp and similar languages, Common Lisp packages and the
 asdf-build-system."
-        #:scope (list (make-regexp "^gnu/packages/lisp(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/lisp(-.+|)\\.scm$")
                       "guix/build/asdf-build-system.scm"
                       "guix/build/lisp-utils.scm"
                       "guix/build-system/asdf.scm")))
@@ -238,7 +258,7 @@ (define-team embedded-bootstrap
 (define-team rust
   (team 'rust
         #:name "Rust"
-        #:scope (list (make-regexp "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
                       "guix/build/cargo-build-system.scm"
                       "guix/build/cargo-utils.scm"
                       "guix/build-system/cargo.scm"
@@ -336,9 +356,9 @@ (define-team core
               "guix/upstream.scm"
               "guix/utils.scm"
               "guix/workers.scm"
-              (make-regexp "^guix/platforms/")
-              (make-regexp "^guix/scripts/")
-              (make-regexp "^guix/store/"))))
+              (make-regexp* "^guix/platforms/")
+              (make-regexp* "^guix/scripts/")
+              (make-regexp* "^guix/store/"))))
 
 (define-team games
   (team 'games
@@ -355,17 +375,17 @@ (define-team translations
   (team 'translations
         #:name "Translations"
         #:scope (list "etc/news.scm"
-                      (make-regexp "^po/"))))
+                      (make-regexp* "^po/"))))
 
 (define-team installer
   (team 'installer
         #:name "Installer script and system installer"
-        #:scope (list (make-regexp "^gnu/installer(\\.scm$|/)"))))
+        #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)"))))
 
 (define-team home
   (team 'home
         #:name "Team for \"Guix Home\""
-        #:scope (list (make-regexp "^(gnu|guix/scripts)/home(\\.scm$|/)")
+        #:scope (list (make-regexp* "^(gnu|guix/scripts)/home(\\.scm$|/)")
                       "tests/guix-home.sh"
                       "tests/home-import.scm"
                       "tests/home-services.scm")))
@@ -501,8 +521,8 @@ (define (find-team-by-scope files)
                 (any (match-lambda
                        ((? string? scope)
                         (string=? scope file))
-                       ((? regexp? scope)
-                        (regexp-exec scope file)))
+                       ((? regexp*? scope)
+                        (regexp-exec* scope file)))
                      (team-scope team)))
               files)
          (cons team acc)
@@ -553,7 +573,13 @@ (define width* (%text-width))
                  "<none>")
              (match (team-scope team)
                (() "")
-               (scope (format #f "scope: ~{~s ~}~%" scope))))
+               (scope (format #f "scope: ~{~s ~}~%"
+                              (sort
+                               (map (match-lambda
+                                      ((? regexp*? rx*) (regexp-pattern* rx*))
+                                      ((? string? str) str))
+                                    scope)
+                               string<=?)))))
      (list-members team port* "+ ")
      (newline))
    %teams))
-- 
2.36.0





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

* [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id.
  2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
@ 2022-10-20 13:28   ` zimoun
  2022-10-20 13:28   ` [bug#58660] [PATCH 4/4] etc: teams: Display an id number zimoun
  2022-11-05 12:18   ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display ( via Guix-patches via
  2 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2022-10-20 13:28 UTC (permalink / raw)
  To: 58660; +Cc: zimoun

* 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)))))))
 
 \f
 (define (diff-revisions rev-start rev-end)
-- 
2.36.0





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

* [bug#58660] [PATCH 4/4] etc: teams: Display an id number.
  2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
  2022-10-20 13:28   ` [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id zimoun
@ 2022-10-20 13:28   ` zimoun
  2022-11-05 12:18   ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display ( via Guix-patches via
  2 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2022-10-20 13:28 UTC (permalink / raw)
  To: 58660; +Cc: zimoun

* etc/teams.scm.in (list-teams): Add id number for easing 'recutils' use.
---
 etc/teams.scm.in | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 3d4c7319c2..790eb17131 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -556,15 +556,16 @@ (define (list-teams)
   "Print all teams, their scope and their members."
   (define port* (current-output-port))
   (define width* (%text-width))
-  (for-each
-   (lambda (team)
+  (fold
+   (lambda (team id-number)
      (format port*
              "\
-id: ~a
+id: (~d) ~a
 name: ~a
 description: ~a
 ~amembers:
 "
+             id-number
              (team-id team)
              (team-name team)
              (or (and=> (team-description team)
@@ -583,7 +584,9 @@ (define width* (%text-width))
                                     scope)
                                string<=?)))))
      (list-members team port* "+ ")
-     (newline))
+     (newline)
+     (1+ id-number))
+   0
    (sort
     (hash-map->list (lambda (key value) value) %teams)
     (lambda (team1 team2)
-- 
2.36.0





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

* [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm
       [not found] <20221020132140.1546684-1-zimon.toutoune@gmail.com>
  2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
@ 2022-11-04 10:11 ` zimoun
  2022-11-09 16:23 ` Mathieu Othacehe
  2022-11-17 20:28 ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand zimoun
  3 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2022-11-04 10:11 UTC (permalink / raw)
  To: 58660; +Cc: dev, zimon.toutoune, othacehe, ludo, mail, rekado

Hi,

CC: core teams


Friendly ping about patch#58660 [1].

1: <http://issues.guix.gnu.org/issue/58660>


On Thu, 20 Oct 2022 at 15:21, zimoun <zimon.toutoune@gmail.com> wrote:


Compare old display with ugly regexp

>  id: java
> name: Java and Maven team
> description: The JDK and JRE, the Maven build system, Java packages, the ant-build-system, and the maven-build-system.
> scope: #<regexp 7f61135ef3c0> #<regexp 7f61135ef380> "guix/build/ant-build-system.scm" "guix/build/java-utils.scm" "guix/build/maven-build-system.scm" #<regexp 7f61135ef340> "guix/build-system/ant.scm" "guix/build-system/maven.scm"
> members:
> + Julien Lepiller <julien@lepiller.eu>
> + Björn Höfling <bjoern.hoefling@bjoernhoefling.de>

with the display by this patch:

> id: java
> name: Java and Maven team
> description: The JDK and JRE, the Maven build system, Java packages, the ant-build-system, and the maven-build-system.
> scope: "^gnu/packages/java(-.+|)\\.scm$" "^gnu/packages/maven(-.+|)\\.scm$" "^guix/build/maven/" "guix/build-system/ant.scm" "guix/build-system/maven.scm" "guix/build/ant-build-system.scm" "guix/build/java-utils.scm" "guix/build/maven-build-system.scm"
> members:
> + Julien Lepiller <julien@lepiller.eu>
> + Björn Höfling <bjoern.hoefling@bjoernhoefling.de>


The second patch sorts the members,

> $ etc/teams.scm list-members mentors
> ( <paren@disroot.org>
> Christopher Baines <mail@cbaines.net>
> Ludovic Courtès <ludo@gnu.org>
> Mathieu Othacehe <othacehe@gnu.org>
> Ricardo Wurmus <rekado@elephly.net>
> Simon Tournier <zimon.toutoune@gmail.com>
> jgart <jgart@dismail.de>


The third patch sorts the teams,

> $ etc/teams.scm list-teams | recsel -Cp id
> id: core
> id: emacs
> id: embedded-bootstrap
> id: games
> id: go
> id: haskell
> id: home
> id: installer
> id: java
> id: julia
> id: kernel
> id: lisp
> id: mentors
> id: mozilla
> id: ocaml
> id: python
> id: r
> id: racket
> id: ruby
> id: rust
> id: science
> id: translations



Last, tangential change… :-)

> Note that show a team is not super handy,
>
> $ etc/teams.scm list-teams | recsel -Cp id | grep -n id
> 1:id: core
> 2:id: emacs
> 3:id: embedded-bootstrap
> 4:id: games
> 5:id: go
> 6:id: haskell
> 7:id: home
> 8:id: installer
> 9:id: java
> 10:id: julia
> 11:id: kernel
> 12:id: lisp
> 13:id: mentors
> 14:id: mozilla
> 15:id: ocaml
> 16:id: python
> 17:id: r
> 18:id: racket
> 19:id: ruby
> 20:id: rust
> 21:id: science
> 22:id: translations
>
> $ etc/teams.scm list-teams | recsel -n 7
> id: installer
> name: Installer script and system installer
> description: <none>
> scope: "^gnu/installer(\\.scm$|/)"
> members:
> + Josselin Poiret <dev@jpoiret.xyz>
> + Mathieu Othacehe <othacehe@gnu.org>
>
>
> Hence the last patch, (hum, I am not convinced :-))
>
> $ etc/teams.scm list-teams | recsel -Cp id
> id: (0) core
> id: (1) emacs
> id: (2) embedded-bootstrap
> id: (3) games
> id: (4) go
> id: (5) haskell
> id: (6) home
> id: (7) installer
> id: (8) java
> id: (9) julia
> id: (10) kernel
> id: (11) lisp
> id: (12) mentors
> id: (13) mozilla
> id: (14) ocaml
> id: (15) python
> id: (16) r
> id: (17) racket
> id: (18) ruby
> id: (19) rust
> id: (20) science
> id: (21) translations
>
> $ etc/teams.scm list-teams | recsel -n 15
> id: (15) python
> name: Python team
> description: Python, Python packages, the "pypi" importer, and the python-build-system.
> scope: "^gnu/packages/python(-.+|)\\.scm$" "gnu/packages/django.scm" "gnu/packages/jupyter.scm" "gnu/packages/sphinx.scm" "gnu/packages/tryton.scm" "guix/build-system/python.scm" "guix/build/python-build-system.scm" "guix/import/pypi.scm" "guix/scripts/import/pypi.scm" "tests/pypi.scm"
> members:
> + Lars-Dominik Braun <lars@6xq.net>
> + jgart <jgart@dismail.de>


Well, if the patches make sense, then I could propose a manual update
(especially some words about recutils which is not common / mainstream.)


Cheers,
simon




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

* [bug#58660] [PATCH 1/4] etc: teams: Improve scope display.
  2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
  2022-10-20 13:28   ` [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id zimoun
  2022-10-20 13:28   ` [bug#58660] [PATCH 4/4] etc: teams: Display an id number zimoun
@ 2022-11-05 12:18   ` ( via Guix-patches via
  2022-11-05 13:09     ` zimoun
  2 siblings, 1 reply; 18+ messages in thread
From: ( via Guix-patches via @ 2022-11-05 12:18 UTC (permalink / raw)
  To: zimoun, 58660

Heya,

On Thu Oct 20, 2022 at 2:28 PM BST, zimoun wrote:
> * etc/teams.scm.in (<regexp*>): New record type.
> (make-regexp*, regexp-exec*): New procedures.
> (python, haskell, julia, java, emacs, rust, core, translations, installer,
> home): Use it.
> (find-team-by-scope): Use it.
> (list-teams): Use it and sort scope files.

> @@ -553,7 +573,13 @@ (define width* (%text-width))
> +               (scope (format #f "scope: ~{~s ~}~%"
> +                              (sort
> +                               (map (match-lambda
> +                                      ((? regexp*? rx*) (regexp-pattern* rx*))
> +                                      ((? string? str) str))
> +                                    scope)
> +                               string<=?)))))

Would it not be better to, instead of displaying the actual regex
itself, display the files that match the regex, and separate the files
onto separate lines? Eg, rather than,

  scope: "^gnu/packages/julia(-.+|).scm$" "guix/build/julia-build-system.scm" "guix/build-system/julia.scm"

we could display,

  scope:
  + gnu/packages/julia.scm
  + gnu/packages/julia-jll.scm
  + gnu/packages/julia-xyz.scm
  + guix/build/julia-build-system.scm
  + guix/build-system/julia.scm

I find this to be much clearer.

    -- (




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

* [bug#58660] [PATCH 1/4] etc: teams: Improve scope display.
  2022-11-05 12:18   ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display ( via Guix-patches via
@ 2022-11-05 13:09     ` zimoun
  2022-11-05 13:29       ` ( via Guix-patches via
  0 siblings, 1 reply; 18+ messages in thread
From: zimoun @ 2022-11-05 13:09 UTC (permalink / raw)
  To: (, 58660

Hi,

On Sat, 05 Nov 2022 at 12:18, "\( via Guix-patches" via <guix-patches@gnu.org> wrote:

> Would it not be better to, instead of displaying the actual regex
> itself, display the files that match the regex, and separate the files
> onto separate lines?

You are proposing 2 things…

>                      Eg, rather than,
>
>   scope: "^gnu/packages/julia(-.+|).scm$" "guix/build/julia-build-system.scm" "guix/build-system/julia.scm"
>
> we could display,
>
>   scope:
>   + gnu/packages/julia.scm
>   + gnu/packages/julia-jll.scm
>   + gnu/packages/julia-xyz.scm
>   + guix/build/julia-build-system.scm
>   + guix/build-system/julia.scm

…one, about expanded regexp.

It means walk the repository tree and it is currently not done – and it
is not a good direction, IMHO.

Well, we could maintain the plain list of files instead of these
regexps.  I am not convinced it would be better.


…two, about item list instead of oneline list.

Some teams have a lot of files, see ’core’.  And I do not have an
opinion about which kind of list is better for readability.


WDYT?

Cheers,
simon





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

* [bug#58660] [PATCH 1/4] etc: teams: Improve scope display.
  2022-11-05 13:09     ` zimoun
@ 2022-11-05 13:29       ` ( via Guix-patches via
  0 siblings, 0 replies; 18+ messages in thread
From: ( via Guix-patches via @ 2022-11-05 13:29 UTC (permalink / raw)
  To: zimoun, 58660

On Sat Nov 5, 2022 at 1:09 PM GMT, zimoun wrote:
> It means walk the repository tree and it is currently not done – and it
> is not a good direction, IMHO.
>
> Well, we could maintain the plain list of files instead of these
> regexps.  I am not convinced it would be better.

I guess it could make list-teams slower, but I don't think it'd matter
too much. It's an infrequently-used script, after all, and I think the
vast majority of machines would be able to run a ftw for each regex
fast enough.

> Some teams have a lot of files, see ’core’.  And I do not have an
> opinion about which kind of list is better for readability.

I find this quite hard to read:

  scope: "guix/avahi.scm" "guix/base16.scm" "guix/base32.scm" "guix/base64.scm" "guix/bzr-download.scm" "guix/cache.scm" "guix/channels.scm" "guix/ci.scm" "guix/colors.scm" "guix/combinators.scm" "guix/config.scm" "guix/cpio.scm" "guix/cpu.scm" "guix/cve.scm" "guix/cvs-download.scm" "guix/deprecation.scm" "guix/derivations.scm" "guix/describe.scm" "guix/diagnostics.scm" "guix/discovery.scm" "guix/docker.scm" "guix/download.scm" "guix/elf.scm" "guix/ftp-client.scm" "guix/gexp.scm" "guix/git-authenticate.scm" "guix/git-download.scm" "guix/git.scm" "guix/glob.scm" "guix/gnu-maintenance.scm" "guix/gnupg.scm" "guix/grafts.scm" "guix/graph.scm" "guix/hash.scm" "guix/hg-download.scm" "guix/http-client.scm" "guix/i18n.scm" "guix/inferior.scm" "guix/ipfs.scm" "guix/least-authority.scm" "guix/licenses.scm" "guix/lint.scm" "guix/man-db.scm" "guix/memoization.scm" "guix/modules.scm" "guix/monad-repl.scm" "guix/monads.scm" "guix/narinfo.scm" "guix/nar.scm" "guix/openpgp.scm" "guix/packages.scm" "guix/pki.scm" "guix/platform.scm" "guix/profiles.scm" "guix/profiling.scm" "guix/progress.scm" "guix/quirks.scm" "guix/read-print.scm" "guix/records.scm" "guix/remote.scm" "guix/repl.scm" "guix/search-paths.scm" "guix/self.scm" "guix/serialization.scm" "guix/sets.scm" "guix/ssh.scm" "guix/status.scm" "guix/store.scm" "guix/substitutes.scm" "guix/svn-download.scm" "guix/swh.scm" "guix/tests.scm" "guix/transformations.scm" "guix/ui.scm" "guix/upstream.scm" "guix/utils.scm" "guix/workers.scm" #<regexp 7f5b707a3bc0> #<regexp 7f5b707a39c0> #<regexp 7f5b707a3980> 

compared to this, even if it's a bit long:

  scope:
  + guix/avahi.scm
  + guix/base16.scm
  + guix/base32.scm
  + guix/base64.scm
  + guix/bzr-download.scm
  + guix/cache.scm
  + guix/channels.scm
  + guix/ci.scm
  + guix/colors.scm
  + guix/combinators.scm
  + guix/config.scm
  + guix/cpio.scm
  + guix/cpu.scm
  + guix/cve.scm
  + guix/cvs-download.scm
  + guix/deprecation.scm
  + guix/derivations.scm
  + guix/describe.scm
  + guix/diagnostics.scm
  + guix/discovery.scm
  + guix/docker.scm
  + guix/download.scm
  + guix/elf.scm
  + guix/ftp-client.scm
  + guix/gexp.scm
  + guix/git-authenticate.scm
  + guix/git-download.scm
  + guix/git.scm
  + guix/glob.scm
  + guix/gnu-maintenance.scm
  + guix/gnupg.scm
  + guix/grafts.scm
  + guix/graph.scm
  + guix/hash.scm
  + guix/hg-download.scm
  + guix/http-client.scm
  + guix/i18n.scm
  + guix/inferior.scm
  + guix/ipfs.scm
  + guix/least-authority.scm
  + guix/licenses.scm
  + guix/lint.scm
  + guix/man-db.scm
  + guix/memoization.scm
  + guix/modules.scm
  + guix/monad-repl.scm
  + guix/monads.scm
  + guix/narinfo.scm
  + guix/nar.scm
  + guix/openpgp.scm
  + guix/packages.scm
  + guix/pki.scm
  + guix/platform.scm
  + guix/profiles.scm
  + guix/profiling.scm
  + guix/progress.scm
  + guix/quirks.scm
  + guix/read-print.scm
  + guix/records.scm
  + guix/remote.scm
  + guix/repl.scm
  + guix/search-paths.scm
  + guix/self.scm
  + guix/serialization.scm
  + guix/sets.scm
  + guix/ssh.scm
  + guix/status.scm
  + guix/store.scm
  + guix/substitutes.scm
  + guix/svn-download.scm
  + guix/swh.scm
  + guix/tests.scm
  + guix/transformations.scm
  + guix/ui.scm
  + guix/upstream.scm
  + guix/utils.scm
  + guix/workers.scm
  + (regex)
  + (regex)
  + (regex)

  -- (




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

* [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm
       [not found] <20221020132140.1546684-1-zimon.toutoune@gmail.com>
  2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
  2022-11-04 10:11 ` [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm zimoun
@ 2022-11-09 16:23 ` Mathieu Othacehe
  2022-11-17 20:27   ` zimoun
  2022-11-17 20:28 ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand zimoun
  3 siblings, 1 reply; 18+ messages in thread
From: Mathieu Othacehe @ 2022-11-09 16:23 UTC (permalink / raw)
  To: zimoun; +Cc: 58660


Hello zimoun,

I applied patches two and three.

Regarding the first patch, I find the paren suggestions quite
nice. Showing the list of affected files can help to tweak the
corresponding regex . The list display of the scope also
appears more readable.

> Hence the last patch, (hum, I am not convinced :-))
>
> $ etc/teams.scm list-teams | recsel -Cp id
> id: (0) core
> id: (1) emacs

Regarding the last patch, I'm also not really convinced that users will
understand that the id is meant as a shortcut for later recsel usage.

Let me know if you'd like to implement what's proposed by paren,
otherwise I think we can close that one :)

Thanks,

Mathieu




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

* [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm
  2022-11-09 16:23 ` Mathieu Othacehe
@ 2022-11-17 20:27   ` zimoun
  2022-11-18 17:31     ` Mathieu Othacehe
  0 siblings, 1 reply; 18+ messages in thread
From: zimoun @ 2022-11-17 20:27 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 58660

Hi,

Please see v2.  Improving on the top (bb4d32b655) of already merged
patches. :-)

On Wed, 09 Nov 2022 at 17:23, Mathieu Othacehe <othacehe@gnu.org> wrote:

> Regarding the last patch, I'm also not really convinced that users will
> understand that the id is meant as a shortcut for later recsel usage.

I have added another subcommand.


--8<---------------cut here---------------start------------->8---
$ ./etc/teams.scm show python
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope: "gnu/packages/django.scm" "gnu/packages/jupyter.scm" #<regexp 7f0e8e231500> "gnu/packages/sphinx.scm" "gnu/packages/tryton.scm" "guix/build/pyproject-build-system.scm" "guix/build-system/pyproject.scm" "guix/build/python-build-system.scm" "guix/build-system/python.scm" "guix/import/pypi.scm" "guix/scripts/import/pypi.scm" "tests/pypi.scm" 
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>
--8<---------------cut here---------------end--------------->8---


> Let me know if you'd like to implement what's proposed by paren,
> otherwise I think we can close that one :)

Well, I am not convinced by walking all the tree.  Therefore, second
patch just itemize the current list.

--8<---------------cut here---------------start------------->8---
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ #<regexp 7f6315fb3500>
+ gnu/packages/django.scm
+ gnu/packages/jupyter.scm
+ gnu/packages/sphinx.scm
+ gnu/packages/tryton.scm
+ guix/build-system/pyproject.scm
+ guix/build-system/python.scm
+ guix/build/pyproject-build-system.scm
+ guix/build/python-build-system.scm
+ guix/import/pypi.scm
+ guix/scripts/import/pypi.scm
+ tests/pypi.scm
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>
--8<---------------cut here---------------end--------------->8---

And the last patch replaces the #<regexp...> by the string pattern.

--8<---------------cut here---------------start------------->8---
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ ^gnu/packages/python(-.+|)\.scm$
+ gnu/packages/django.scm
+ gnu/packages/jupyter.scm
+ gnu/packages/sphinx.scm
+ gnu/packages/tryton.scm
+ guix/build-system/pyproject.scm
+ guix/build-system/python.scm
+ guix/build/pyproject-build-system.scm
+ guix/build/python-build-system.scm
+ guix/import/pypi.scm
+ guix/scripts/import/pypi.scm
+ tests/pypi.scm
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>
--8<---------------cut here---------------end--------------->8---

Well, all are an improvement, I guess.  Then, even if merged, we can
still improve and walk the tree. :-)


Cheers,
simon




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

* [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
       [not found] <20221020132140.1546684-1-zimon.toutoune@gmail.com>
                   ` (2 preceding siblings ...)
  2022-11-09 16:23 ` Mathieu Othacehe
@ 2022-11-17 20:28 ` zimoun
  2022-11-17 20:28   ` [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field zimoun
                     ` (2 more replies)
  3 siblings, 3 replies; 18+ messages in thread
From: zimoun @ 2022-11-17 20:28 UTC (permalink / raw)
  To: 58660; +Cc: othacehe, zimoun

* etc/teams.scm.in: Add 'show' subcommand.
---
 etc/teams.scm.in | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index c458b14e3b..e4e0dc209d 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,6 +5,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -538,7 +539,7 @@ (define port* (or port (current-output-port)))
     (team-members team)
     (lambda (m1 m2) (string<? (person-name m1) (person-name m2))))))
 
-(define (list-teams)
+(define* (list-teams #:optional team-names)
   "Print all teams, their scope and their members."
   (define port* (current-output-port))
   (define width* (%text-width))
@@ -564,11 +565,13 @@ (define width* (%text-width))
                (scope (format #f "scope: ~{~s ~}~%" scope))))
      (list-members team port* "+ ")
      (newline))
-   (sort
-    (hash-map->list (lambda (key value) value) %teams)
-    (lambda (team1 team2)
-      (string<? (symbol->string (team-id team1))
-                (symbol->string (team-id team2)))))))
+   (if team-names
+       (map find-team team-names)
+       (sort
+        (hash-map->list (lambda (key value) value) %teams)
+        (lambda (team1 team2)
+          (string<? (symbol->string (team-id team1))
+                    (symbol->string (team-id team2))))))))
 
 \f
 (define (diff-revisions rev-start rev-end)
@@ -611,6 +614,8 @@ (define (main . args)
       (lambda (team-name)
         (list-members (find-team team-name)))
       team-names))
+    (("show" . team-names)
+     (list-teams team-names))
     (anything
      (format (current-error-port)
              "Usage: etc/teams.scm <command> [<args>]
@@ -619,6 +624,7 @@ (define (main . args)
   cc <team-name>            get git send-email flags for cc-ing <team-name>
   cc-members <start> <end>  cc teams related to files changed between revisions
   list-teams                list teams and their members
-  list-members <team-name>  list members belonging to <team-name>~%"))))
+  list-members <team-name>  list members belonging to <team-name>
+  show <team-name>          display <team-name> properties~%"))))
 
 (apply main (cdr (command-line)))
-- 
2.38.1





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

* [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field.
  2022-11-17 20:28 ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand zimoun
@ 2022-11-17 20:28   ` zimoun
  2022-11-18 17:23     ` Mathieu Othacehe
  2022-11-17 20:28   ` [bug#58660] [PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field zimoun
  2022-11-18 17:29   ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand Mathieu Othacehe
  2 siblings, 1 reply; 18+ messages in thread
From: zimoun @ 2022-11-17 20:28 UTC (permalink / raw)
  To: 58660; +Cc: othacehe, zimoun

* etc/teams.scm.in (list-teams): Sort and itemize the 'scope' field.
---
 etc/teams.scm.in | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index e4e0dc209d..3f90e0e6f2 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -562,7 +562,14 @@ (define width* (%text-width))
                  "<none>")
              (match (team-scope team)
                (() "")
-               (scope (format #f "scope: ~{~s ~}~%" scope))))
+               (scope-files
+                (fold
+                 (lambda (str fmt)
+                   (string-append fmt str))
+                 (format #f "scope:~%")
+                 (sort
+                  (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)
+                  string<=?)))))
      (list-members team port* "+ ")
      (newline))
    (if team-names
-- 
2.38.1





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

* [bug#58660] [PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field.
  2022-11-17 20:28 ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand zimoun
  2022-11-17 20:28   ` [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field zimoun
@ 2022-11-17 20:28   ` zimoun
  2022-11-18 17:29   ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand Mathieu Othacehe
  2 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2022-11-17 20:28 UTC (permalink / raw)
  To: 58660; +Cc: othacehe, zimoun

* etc/teams.scm.in (<regexp*>): New record type.
(make-regexp*, regexp-exec*): New procedures.
(python, haskell, julia, java, emacs, rust, core, translations, installer,
home): Use it.
(find-team-by-scope): Use it.
(list-teams): Use it.
---
 etc/teams.scm.in | 59 +++++++++++++++++++++++++++++++++---------------
 1 file changed, 41 insertions(+), 18 deletions(-)

diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 3f90e0e6f2..3bdf91597f 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -38,6 +38,25 @@
              (guix ui)
              (git))
 
+;;; Work around regexp implementation.
+;;; This record allows to track the regexp pattern and then display it.
+(define-record-type <regexp*>
+  (regexp* pat flag)
+  regexp*?
+  (pat regexp-pattern*)
+  (flag regexp-flag*))
+
+(define* (make-regexp* pat #:optional flag)
+  (regexp* pat flag))
+
+(define (regexp-exec* rx* str)
+  (let ((rx (make-regexp
+             (regexp-pattern* rx*)
+             (or (regexp-flag* rx*)
+                 regexp/extended))))
+    (regexp-exec rx str)))
+
+\f
 (define-record-type <team>
   (make-team id name description members scope)
   team?
@@ -98,7 +117,7 @@ (define-team python
         (list "gnu/packages/django.scm"
               "gnu/packages/jupyter.scm"
               ;; Match haskell.scm and haskell-*.scm.
-              (make-regexp "^gnu/packages/python(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/python(-.+|)\\.scm$")
               "gnu/packages/sphinx.scm"
               "gnu/packages/tryton.scm"
               "guix/build/pyproject-build-system.scm"
@@ -118,7 +137,7 @@ (define-team haskell
         #:scope
         (list "gnu/packages/dhall.scm"
               ;; Match haskell.scm and haskell-*.scm.
-              (make-regexp "^gnu/packages/haskell(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/haskell(-.+|)\\.scm$")
               "gnu/packages/purescript.scm"
               "guix/build/haskell-build-system.scm"
               "guix/build-system/haskell.scm"
@@ -146,7 +165,7 @@ (define-team julia
         #:name "Julia team"
         #:description
         "The Julia language, Julia packages, and the julia-build-system."
-        #:scope (list (make-regexp "^gnu/packages/julia(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/julia(-.+|)\\.scm$")
                       "guix/build/julia-build-system.scm"
                       "guix/build-system/julia.scm")))
 
@@ -175,14 +194,14 @@ (define-team java
 and the maven-build-system."
         #:scope
         (list ;; Match java.scm and java-*.scm.
-              (make-regexp "^gnu/packages/java(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/java(-.+|)\\.scm$")
               ;; Match maven.scm and maven-*.scm
-              (make-regexp "^gnu/packages/maven(-.+|)\\.scm$")
+              (make-regexp* "^gnu/packages/maven(-.+|)\\.scm$")
               "guix/build/ant-build-system.scm"
               "guix/build/java-utils.scm"
               "guix/build/maven-build-system.scm"
               ;; The maven directory
-              (make-regexp "^guix/build/maven/")
+              (make-regexp* "^guix/build/maven/")
               "guix/build-system/ant.scm"
               "guix/build-system/maven.scm")))
 
@@ -195,7 +214,7 @@ (define-team emacs
         #:name "Emacs team"
         #:description "The extensible, customizable text editor and its
 ecosystem."
-        #:scope (list (make-regexp "^gnu/packages/emacs(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/emacs(-.+|)\\.scm$")
                       "guix/build/emacs-build-system.scm"
                       "guix/build/emacs-utils.scm"
                       "guix/build-system/emacs.scm"
@@ -209,7 +228,7 @@ (define-team lisp
         #:description
         "Common Lisp and similar languages, Common Lisp packages and the
 asdf-build-system."
-        #:scope (list (make-regexp "^gnu/packages/lisp(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/lisp(-.+|)\\.scm$")
                       "guix/build/asdf-build-system.scm"
                       "guix/build/lisp-utils.scm"
                       "guix/build-system/asdf.scm")))
@@ -241,7 +260,7 @@ (define-team embedded-bootstrap
 (define-team rust
   (team 'rust
         #:name "Rust"
-        #:scope (list (make-regexp "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
+        #:scope (list (make-regexp* "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
                       "guix/build/cargo-build-system.scm"
                       "guix/build/cargo-utils.scm"
                       "guix/build-system/cargo.scm"
@@ -339,9 +358,9 @@ (define-team core
               "guix/upstream.scm"
               "guix/utils.scm"
               "guix/workers.scm"
-              (make-regexp "^guix/platforms/")
-              (make-regexp "^guix/scripts/")
-              (make-regexp "^guix/store/"))))
+              (make-regexp* "^guix/platforms/")
+              (make-regexp* "^guix/scripts/")
+              (make-regexp* "^guix/store/"))))
 
 (define-team games
   (team 'games
@@ -358,17 +377,17 @@ (define-team translations
   (team 'translations
         #:name "Translations"
         #:scope (list "etc/news.scm"
-                      (make-regexp "^po/"))))
+                      (make-regexp* "^po/"))))
 
 (define-team installer
   (team 'installer
         #:name "Installer script and system installer"
-        #:scope (list (make-regexp "^gnu/installer(\\.scm$|/)"))))
+        #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)"))))
 
 (define-team home
   (team 'home
         #:name "Team for \"Guix Home\""
-        #:scope (list (make-regexp "^(gnu|guix/scripts)/home(\\.scm$|/)")
+        #:scope (list (make-regexp* "^(gnu|guix/scripts)/home(\\.scm$|/)")
                       "tests/guix-home.sh"
                       "tests/home-import.scm"
                       "tests/home-services.scm")))
@@ -508,8 +527,8 @@ (define (find-team-by-scope files)
                 (any (match-lambda
                        ((? string? scope)
                         (string=? scope file))
-                       ((? regexp? scope)
-                        (regexp-exec scope file)))
+                       ((? regexp*? scope)
+                        (regexp-exec* scope file)))
                      (team-scope team)))
               files)
          (cons team acc)
@@ -568,7 +587,11 @@ (define width* (%text-width))
                    (string-append fmt str))
                  (format #f "scope:~%")
                  (sort
-                  (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)
+                  (map (compose (cut format #f "+ ~a~%" <>)
+                                (match-lambda
+                                  ((? regexp*? rx*) (regexp-pattern* rx*))
+                                  ((? string? str) str)))
+                       scope-files)
                   string<=?)))))
      (list-members team port* "+ ")
      (newline))
-- 
2.38.1





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

* [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field.
  2022-11-17 20:28   ` [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field zimoun
@ 2022-11-18 17:23     ` Mathieu Othacehe
  2022-11-21 14:11       ` zimoun
  0 siblings, 1 reply; 18+ messages in thread
From: Mathieu Othacehe @ 2022-11-18 17:23 UTC (permalink / raw)
  To: zimoun; +Cc: 58660


Hello,

> +               (scope-files
> +                (fold
> +                 (lambda (str fmt)
> +                   (string-append fmt str))
> +                 (format #f "scope:~%")
> +                 (sort
> +                  (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)

Why not:

(scope (format #f "scope:~%~{+ ~s ~}~%" scope))

> +                  string<=?)))))

At that point, scope is not always a string:

--8<---------------cut here---------------start------------->8---
ERROR: In procedure string<=?:
In procedure string<=: Wrong type argument in position 1 (expecting string): #<regexp 7fd842030980>
--8<---------------cut here---------------end--------------->8---

Thanks,

Mathieu




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

* [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
  2022-11-17 20:28 ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand zimoun
  2022-11-17 20:28   ` [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field zimoun
  2022-11-17 20:28   ` [bug#58660] [PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field zimoun
@ 2022-11-18 17:29   ` Mathieu Othacehe
  2022-11-21 16:00     ` zimoun
  2 siblings, 1 reply; 18+ messages in thread
From: Mathieu Othacehe @ 2022-11-18 17:29 UTC (permalink / raw)
  To: zimoun; +Cc: 58660


Hello,

>    "Print all teams, their scope and their members."
>    (define port* (current-output-port))
>    (define width* (%text-width))
> @@ -564,11 +565,13 @@ (define width* (%text-width))
>                 (scope (format #f "scope: ~{~s ~}~%" scope))))
>       (list-members team port* "+ ")
>       (newline))

This procedure is starting to get a little complex. We could put the
above is a sub-procedure called "print-team".

> +       (sort
> +        (hash-map->list (lambda (key value) value) %teams)
> +        (lambda (team1 team2)
> +          (string<? (symbol->string (team-id team1))
> +                    (symbol->string (team-id team2))))))))

That could be in a variable called %sorted-teams.

Thanks,

Mathieu




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

* [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm
  2022-11-17 20:27   ` zimoun
@ 2022-11-18 17:31     ` Mathieu Othacehe
  0 siblings, 0 replies; 18+ messages in thread
From: Mathieu Othacehe @ 2022-11-18 17:31 UTC (permalink / raw)
  To: zimoun; +Cc: 58660


Hey,

Thanks for the v2 :)

> I have added another subcommand.
>
> $ ./etc/teams.scm show python

Nice.

> Well, all are an improvement, I guess.  Then, even if merged, we can
> still improve and walk the tree. :-)

Sure, seems like a good start indeed.

I made a few comments, could you please send a v3?

Thanks,

Mathieu




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

* [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field.
  2022-11-18 17:23     ` Mathieu Othacehe
@ 2022-11-21 14:11       ` zimoun
  2023-08-29 18:58         ` bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm Maxim Cournoyer
  0 siblings, 1 reply; 18+ messages in thread
From: zimoun @ 2022-11-21 14:11 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 58660

Hi Mathieu,

On Fri, 18 Nov 2022 at 18:23, Mathieu Othacehe <othacehe@gnu.org> wrote:


> Why not:
>
> (scope (format #f "scope:~%~{+ ~s ~}~%" scope))

Because this does not “itemize” correctly.  For instance, it outputs:

--8<---------------cut here---------------start------------->8---
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ "gnu/packages/django.scm" + "gnu/packages/jupyter.scm" + #<regexp 7f408800d500> + "gnu/packages/sphinx.scm" + "gnu/packages/tryton.scm" + "guix/build/pyproject-build-system.scm" + "guix/build-system/pyproject.scm" + "guix/build/python-build-system.scm" + "guix/build-system/python.scm" + "guix/import/pypi.scm" + "guix/scripts/import/pypi.scm" + "tests/pypi.scm" 
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>
--8<---------------cut here---------------end--------------->8---

When what we want is:

--8<---------------cut here---------------start------------->8---
scope:
+ "gnu/packages/django.scm"
+ "gnu/packages/jupyter.scm"
+ #<regexp 7f408800d500>
+ "gnu/packages/sphinx.scm"
+ "gnu/packages/tryton.scm"
+ "guix/build/pyproject-build-system.scm"
+ "guix/build-system/pyproject.scm"
+ "guix/build/python-build-system.scm"
+ "guix/build-system/python.scm"
+ "guix/import/pypi.scm"
+ "guix/scripts/import/pypi.scm"
+ "tests/pypi.scm" 
--8<---------------cut here---------------end--------------->8---

Well, the ’~%’ is included:

    (scope (format #f "scope:~%~{+ ~s~% ~}~%" scope))))

then there is one extra:

--8<---------------cut here---------------start------------->8---
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ "gnu/packages/django.scm"
 + "gnu/packages/jupyter.scm"
 + #<regexp 7f40de756500>
 + "gnu/packages/sphinx.scm"
 + "gnu/packages/tryton.scm"
 + "guix/build/pyproject-build-system.scm"
 + "guix/build-system/pyproject.scm"
 + "guix/build/python-build-system.scm"
 + "guix/build-system/python.scm"
 + "guix/import/pypi.scm"
 + "guix/scripts/import/pypi.scm"
 + "tests/pypi.scm"
 
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>
--8<---------------cut here---------------end--------------->8---


>> +                  string<=?)))))
>
> At that point, scope is not always a string:
>
> --8<---------------cut here---------------start------------->8---
> ERROR: In procedure string<=?:
> In procedure string<=: Wrong type argument in position 1 (expecting string): #<regexp 7fd842030980>
> --8<---------------cut here---------------end--------------->8---

Hum, I miss how you get that.  This,

    (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)

transforms all as string.  For instance, applying this patch on the top
of the introduction of “./etc/teams.scm show”, I get:

--8<---------------cut here---------------start------------->8---
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ #<regexp 7fc05bdd6500>
+ gnu/packages/django.scm
+ gnu/packages/jupyter.scm
+ gnu/packages/sphinx.scm
+ gnu/packages/tryton.scm
+ guix/build-system/pyproject.scm
+ guix/build-system/python.scm
+ guix/build/pyproject-build-system.scm
+ guix/build/python-build-system.scm
+ guix/import/pypi.scm
+ guix/scripts/import/pypi.scm
+ tests/pypi.scm
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>
--8<---------------cut here---------------end--------------->8---


Cheers,
simon




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

* [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
  2022-11-18 17:29   ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand Mathieu Othacehe
@ 2022-11-21 16:00     ` zimoun
  0 siblings, 0 replies; 18+ messages in thread
From: zimoun @ 2022-11-21 16:00 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 58660

Hi Mathieu,

On Fri, 18 Nov 2022 at 18:29, Mathieu Othacehe <othacehe@gnu.org> wrote:

> This procedure is starting to get a little complex. We could put the
> above is a sub-procedure called "print-team".

I will try to revamp for a v3.

>> +       (sort
>> +        (hash-map->list (lambda (key value) value) %teams)
>> +        (lambda (team1 team2)
>> +          (string<? (symbol->string (team-id team1))
>> +                    (symbol->string (team-id team2))))))))
>
> That could be in a variable called %sorted-teams.

This had been introduced by 18fb7c0f3078216bf4fc865d86b3be76ddc68414.
Indeed, it could be extracted; part of the revamp.


Cheers,
simon




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

* bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm
  2022-11-21 14:11       ` zimoun
@ 2023-08-29 18:58         ` Maxim Cournoyer
  0 siblings, 0 replies; 18+ messages in thread
From: Maxim Cournoyer @ 2023-08-29 18:58 UTC (permalink / raw)
  To: zimoun; +Cc: Mathieu Othacehe, 58660-done

Hi,

zimoun <zimon.toutoune@gmail.com> writes:

> Hi Mathieu,
>
> On Fri, 18 Nov 2022 at 18:23, Mathieu Othacehe <othacehe@gnu.org> wrote:
>
>
>> Why not:
>>
>> (scope (format #f "scope:~%~{+ ~s ~}~%" scope))
>
> Because this does not “itemize” correctly.  For instance, it outputs:
>
> id: python
> name: Python team
> description: Python, Python packages, the "pypi" importer, and the python-build-system.
> scope:
> + "gnu/packages/django.scm" + "gnu/packages/jupyter.scm" + #<regexp 7f408800d500> + "gnu/packages/sphinx.scm" + "gnu/packages/tryton.scm" + "guix/build/pyproject-build-system.scm" + "guix/build-system/pyproject.scm" + "guix/build/python-build-system.scm" + "guix/build-system/python.scm" + "guix/import/pypi.scm" + "guix/scripts/import/pypi.scm" + "tests/pypi.scm" 
> members:
> + Lars-Dominik Braun <lars@6xq.net>
> + jgart <jgart@dismail.de>
>
>
> When what we want is:
>
> scope:
> + "gnu/packages/django.scm"
> + "gnu/packages/jupyter.scm"
> + #<regexp 7f408800d500>
> + "gnu/packages/sphinx.scm"
> + "gnu/packages/tryton.scm"
> + "guix/build/pyproject-build-system.scm"
> + "guix/build-system/pyproject.scm"
> + "guix/build/python-build-system.scm"
> + "guix/build-system/python.scm"
> + "guix/import/pypi.scm"
> + "guix/scripts/import/pypi.scm"
> + "tests/pypi.scm" 
>
>
> Well, the ’~%’ is included:
>
>     (scope (format #f "scope:~%~{+ ~s~% ~}~%" scope))))
>
> then there is one extra:
>
> id: python
> name: Python team
> description: Python, Python packages, the "pypi" importer, and the python-build-system.
> scope:
> + "gnu/packages/django.scm"
>  + "gnu/packages/jupyter.scm"
>  + #<regexp 7f40de756500>
>  + "gnu/packages/sphinx.scm"
>  + "gnu/packages/tryton.scm"
>  + "guix/build/pyproject-build-system.scm"
>  + "guix/build-system/pyproject.scm"
>  + "guix/build/python-build-system.scm"
>  + "guix/build-system/python.scm"
>  + "guix/import/pypi.scm"
>  + "guix/scripts/import/pypi.scm"
>  + "tests/pypi.scm"
>  
> members:
> + Lars-Dominik Braun <lars@6xq.net>
> + jgart <jgart@dismail.de>

That's fixable with the 'escape' escape, ~^:

--8<---------------cut here---------------start------------->8---
(format #f "scope:~%~{+ ~a~^~%~}~%" scope)
--8<---------------cut here---------------end--------------->8---

I've reworked your v2, integrating the comments from Mathieu and
installed it as 4d7b25a0e2abd77625cdc888c60da8e6add02bbd.

Closing!

-- 
Thanks,
Maxim




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

end of thread, other threads:[~2023-08-29 19:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20221020132140.1546684-1-zimon.toutoune@gmail.com>
2022-10-20 13:28 ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display zimoun
2022-10-20 13:28   ` [bug#58660] [PATCH 3/4] etc: teams: List teams sorted by id zimoun
2022-10-20 13:28   ` [bug#58660] [PATCH 4/4] etc: teams: Display an id number zimoun
2022-11-05 12:18   ` [bug#58660] [PATCH 1/4] etc: teams: Improve scope display ( via Guix-patches via
2022-11-05 13:09     ` zimoun
2022-11-05 13:29       ` ( via Guix-patches via
2022-11-04 10:11 ` [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm zimoun
2022-11-09 16:23 ` Mathieu Othacehe
2022-11-17 20:27   ` zimoun
2022-11-18 17:31     ` Mathieu Othacehe
2022-11-17 20:28 ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand zimoun
2022-11-17 20:28   ` [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field zimoun
2022-11-18 17:23     ` Mathieu Othacehe
2022-11-21 14:11       ` zimoun
2023-08-29 18:58         ` bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm Maxim Cournoyer
2022-11-17 20:28   ` [bug#58660] [PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field zimoun
2022-11-18 17:29   ` [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand Mathieu Othacehe
2022-11-21 16:00     ` zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).