Package: guix-patches;
Reported by: zimoun <zimon.toutoune <at> gmail.com>
Date: Thu, 20 Oct 2022 13:23:02 UTC
Severity: normal
Tags: moreinfo, patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58660 in the body.
You can then email your comments to 58660 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 20 Oct 2022 13:23:02 GMT) Full text and rfc822 format available.zimoun <zimon.toutoune <at> gmail.com>
:guix-patches <at> gnu.org
.
(Thu, 20 Oct 2022 13:23:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: guix-patches <at> gnu.org Cc: zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH 0/4] Minor tweaks of etc/teams.scm Date: Thu, 20 Oct 2022 15:21:40 +0200
Hi, The first patch displays the regexp pattern and sort the files. Compare, --8<---------------cut here---------------start------------->8--- $ etc/teams.scm list-teams | recsel -n 21 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 <at> lepiller.eu> + Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de> --8<---------------cut here---------------end--------------->8--- with --8<---------------cut here---------------start------------->8--- 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 <at> lepiller.eu> + Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de> --8<---------------cut here---------------end--------------->8--- Maybe I miss a point about regexp but I have not found a way to access the pattern. Hence this new <regexp*> record. The second patch sorts the members, --8<---------------cut here---------------start------------->8--- $ etc/teams.scm list-members mentors ( <paren <at> disroot.org> Christopher Baines <mail <at> cbaines.net> Ludovic Courtès <ludo <at> gnu.org> Mathieu Othacehe <othacehe <at> gnu.org> Ricardo Wurmus <rekado <at> elephly.net> Simon Tournier <zimon.toutoune <at> gmail.com> jgart <jgart <at> dismail.de> --8<---------------cut here---------------end--------------->8--- The third patch sorts the teams, --8<---------------cut here---------------start------------->8--- $ 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 --8<---------------cut here---------------end--------------->8--- Note that show a team is not super handy, --8<---------------cut here---------------start------------->8--- $ 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 <at> jpoiret.xyz> + Mathieu Othacehe <othacehe <at> gnu.org> --8<---------------cut here---------------end--------------->8--- Hence the last patch, (hum, I am not convinced :-)) --8<---------------cut here---------------start------------->8--- $ 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 <at> 6xq.net> + jgart <jgart <at> dismail.de> --8<---------------cut here---------------end--------------->8--- Cheers, simon zimoun (4): etc: teams: Improve scope display. etc: teams: List members sorted by name. etc: teams: List teams sorted by id. etc: teams: Display an id number. etc/teams.scm.in | 83 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 24 deletions(-) base-commit: 4716cea6256523a8ecf90a426d675bfb7620f3e4 -- 2.36.0
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 20 Oct 2022 13:29:02 GMT) Full text and rfc822 format available.Message #8 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: zimoun <zimon.toutoune <at> gmail.com> Subject: [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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 20 Oct 2022 13:29:02 GMT) Full text and rfc822 format available.Message #11 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH 4/4] etc: teams: Display an id number. Date: Thu, 20 Oct 2022 15:28:14 +0200
* 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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 20 Oct 2022 13:29:03 GMT) Full text and rfc822 format available.Message #14 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH 2/4] etc: teams: List members sorted by name. Date: Thu, 20 Oct 2022 15:28:12 +0200
* etc/teams.scm.in (list-members): Sort by name. --- etc/teams.scm.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/teams.scm.in b/etc/teams.scm.in index 394e4d7d46..8e18a5d206 100644 --- a/etc/teams.scm.in +++ b/etc/teams.scm.in @@ -548,7 +548,9 @@ (define port* (or port (current-output-port))) prefix (person-name member) (person-email member))) - (team-members team))) + (sort + (team-members team) + (lambda (m1 m2) (string<? (person-name m1) (person-name m2)))))) (define (list-teams) "Print all teams, their scope and their members." -- 2.36.0
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 20 Oct 2022 13:29:03 GMT) Full text and rfc822 format available.Message #17 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH 1/4] etc: teams: Improve scope display. Date: Thu, 20 Oct 2022 15:28:11 +0200
* 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 <at> elephly.net> ;;; Copyright © 2022 Mathieu Othacehe <othacehe <at> gnu.org> +;;; Copyright © 2022 Simon Tournier <zimon.toutoune <at> 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))) + + (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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Fri, 04 Nov 2022 10:15:02 GMT) Full text and rfc822 format available.Message #20 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: dev <at> jpoiret.xyz, zimon.toutoune <at> gmail.com, othacehe <at> gnu.org, ludo <at> gnu.org, mail <at> cbaines.net, rekado <at> elephly.net Subject: Re: bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm Date: Fri, 04 Nov 2022 11:11:13 +0100
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 <at> 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 <at> lepiller.eu> > + Björn Höfling <bjoern.hoefling <at> 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 <at> lepiller.eu> > + Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de> The second patch sorts the members, > $ etc/teams.scm list-members mentors > ( <paren <at> disroot.org> > Christopher Baines <mail <at> cbaines.net> > Ludovic Courtès <ludo <at> gnu.org> > Mathieu Othacehe <othacehe <at> gnu.org> > Ricardo Wurmus <rekado <at> elephly.net> > Simon Tournier <zimon.toutoune <at> gmail.com> > jgart <jgart <at> 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 <at> jpoiret.xyz> > + Mathieu Othacehe <othacehe <at> 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 <at> 6xq.net> > + jgart <jgart <at> 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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Sat, 05 Nov 2022 12:19:01 GMT) Full text and rfc822 format available.Message #23 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: "(" <paren <at> disroot.org> To: "zimoun" <zimon.toutoune <at> gmail.com>, <58660 <at> debbugs.gnu.org> Subject: Re: [bug#58660] [PATCH 1/4] etc: teams: Improve scope display. Date: Sat, 05 Nov 2022 12:18:12 +0000
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. -- (
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Sat, 05 Nov 2022 13:20:02 GMT) Full text and rfc822 format available.Message #26 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: "(" <paren <at> disroot.org>, 58660 <at> debbugs.gnu.org Subject: Re: [bug#58660] [PATCH 1/4] etc: teams: Improve scope display. Date: Sat, 05 Nov 2022 14:09:43 +0100
Hi, On Sat, 05 Nov 2022 at 12:18, "\( via Guix-patches" via <guix-patches <at> 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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Sat, 05 Nov 2022 13:31:02 GMT) Full text and rfc822 format available.Message #29 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: "(" <paren <at> disroot.org> To: "zimoun" <zimon.toutoune <at> gmail.com>, <58660 <at> debbugs.gnu.org> Subject: Re: [bug#58660] [PATCH 1/4] etc: teams: Improve scope display. Date: Sat, 05 Nov 2022 13:29:59 +0000
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) -- (
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Wed, 09 Nov 2022 16:24:02 GMT) Full text and rfc822 format available.Message #32 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: Mathieu Othacehe <othacehe <at> gnu.org> To: zimoun <zimon.toutoune <at> gmail.com> Cc: 58660 <at> debbugs.gnu.org Subject: Re: bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm Date: Wed, 09 Nov 2022 17:23:45 +0100
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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 17 Nov 2022 20:29:01 GMT) Full text and rfc822 format available.Message #35 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: othacehe <at> gnu.org, zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field. Date: Thu, 17 Nov 2022 21:28:19 +0100
* 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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 17 Nov 2022 20:29:02 GMT) Full text and rfc822 format available.Message #38 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: othacehe <at> gnu.org, zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field. Date: Thu, 17 Nov 2022 21:28:20 +0100
* 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))) + + (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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 17 Nov 2022 20:29:02 GMT) Full text and rfc822 format available.Message #41 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: 58660 <at> debbugs.gnu.org Cc: othacehe <at> gnu.org, zimoun <zimon.toutoune <at> gmail.com> Subject: [PATCH v2 1/3] etc: teams: Add 'show' subcommand. Date: Thu, 17 Nov 2022 21:28:18 +0100
* 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 <at> elephly.net> ;;; Copyright © 2022 Mathieu Othacehe <othacehe <at> gnu.org> +;;; Copyright © 2022 Simon Tournier <zimon.toutoune <at> 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)))))))) (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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Thu, 17 Nov 2022 20:29:03 GMT) Full text and rfc822 format available.Message #44 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: Mathieu Othacehe <othacehe <at> gnu.org> Cc: 58660 <at> debbugs.gnu.org Subject: Re: [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm Date: Thu, 17 Nov 2022 21:27:19 +0100
Hi, Please see v2. Improving on the top (bb4d32b655) of already merged patches. :-) On Wed, 09 Nov 2022 at 17:23, Mathieu Othacehe <othacehe <at> 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 <at> 6xq.net> + jgart <jgart <at> 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 <at> 6xq.net> + jgart <jgart <at> 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 <at> 6xq.net> + jgart <jgart <at> 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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Fri, 18 Nov 2022 17:24:02 GMT) Full text and rfc822 format available.Message #47 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: Mathieu Othacehe <othacehe <at> gnu.org> To: zimoun <zimon.toutoune <at> gmail.com> Cc: 58660 <at> debbugs.gnu.org Subject: Re: [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field. Date: Fri, 18 Nov 2022 18:23:40 +0100
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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Fri, 18 Nov 2022 17:30:02 GMT) Full text and rfc822 format available.Message #50 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: Mathieu Othacehe <othacehe <at> gnu.org> To: zimoun <zimon.toutoune <at> gmail.com> Cc: 58660 <at> debbugs.gnu.org Subject: Re: [PATCH v2 1/3] etc: teams: Add 'show' subcommand. Date: Fri, 18 Nov 2022 18:29:50 +0100
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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Fri, 18 Nov 2022 17:32:01 GMT) Full text and rfc822 format available.Message #53 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: Mathieu Othacehe <othacehe <at> gnu.org> To: zimoun <zimon.toutoune <at> gmail.com> Cc: 58660 <at> debbugs.gnu.org Subject: Re: [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm Date: Fri, 18 Nov 2022 18:31:11 +0100
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
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Mon, 21 Nov 2022 15:03:01 GMT) Full text and rfc822 format available.Message #56 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: Mathieu Othacehe <othacehe <at> gnu.org> Cc: 58660 <at> debbugs.gnu.org Subject: Re: [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field. Date: Mon, 21 Nov 2022 15:11:33 +0100
Hi Mathieu, On Fri, 18 Nov 2022 at 18:23, Mathieu Othacehe <othacehe <at> 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 <at> 6xq.net> + jgart <jgart <at> 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 <at> 6xq.net> + jgart <jgart <at> 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 <at> 6xq.net> + jgart <jgart <at> dismail.de> --8<---------------cut here---------------end--------------->8--- Cheers, simon
guix-patches <at> gnu.org
:bug#58660
; Package guix-patches
.
(Mon, 21 Nov 2022 16:02:01 GMT) Full text and rfc822 format available.Message #59 received at 58660 <at> debbugs.gnu.org (full text, mbox):
From: zimoun <zimon.toutoune <at> gmail.com> To: Mathieu Othacehe <othacehe <at> gnu.org> Cc: 58660 <at> debbugs.gnu.org Subject: Re: [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand. Date: Mon, 21 Nov 2022 17:00:52 +0100
Hi Mathieu, On Fri, 18 Nov 2022 at 18:29, Mathieu Othacehe <othacehe <at> 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
Christopher Baines <mail <at> cbaines.net>
to control <at> debbugs.gnu.org
.
(Wed, 23 Nov 2022 09:16:01 GMT) Full text and rfc822 format available.Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:zimoun <zimon.toutoune <at> gmail.com>
:Message #66 received at 58660-done <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: zimoun <zimon.toutoune <at> gmail.com> Cc: Mathieu Othacehe <othacehe <at> gnu.org>, 58660-done <at> debbugs.gnu.org Subject: Re: bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm Date: Tue, 29 Aug 2023 14:58:09 -0400
Hi, zimoun <zimon.toutoune <at> gmail.com> writes: > Hi Mathieu, > > On Fri, 18 Nov 2022 at 18:23, Mathieu Othacehe <othacehe <at> 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 <at> 6xq.net> > + jgart <jgart <at> 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 <at> 6xq.net> > + jgart <jgart <at> 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
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Wed, 27 Sep 2023 11:24:11 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.