diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2022-07-03 14:11:29 +0200 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2022-07-03 14:12:32 +0200 |
| commit | 4eaf90470f466b3fdab87f6961cb18bb348d433f (patch) | |
| tree | 154008ef0a07f938ecedc431a876b35f8da67c07 | |
| parent | cba98b58bf09f22dfbfb338884b80ab831e0be46 (diff) | |
etc: Add teams.scm.
* etc/teams.scm.in: New file.
* configure.ac: Generate executable.
* .gitignore: Ignore generated file.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | etc/teams.scm.in | 257 |
3 files changed, 259 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index 18e1b0739f8..34414d1e95c 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -68,6 +68,7 @@ | |||
| 68 | /doc/version.texi | 68 | /doc/version.texi |
| 69 | /doc/version-*.texi | 69 | /doc/version-*.texi |
| 70 | /etc/committer.scm | 70 | /etc/committer.scm |
| 71 | /etc/teams.scm | ||
| 71 | /etc/gnu-store.mount | 72 | /etc/gnu-store.mount |
| 72 | /etc/guix-daemon.cil | 73 | /etc/guix-daemon.cil |
| 73 | /etc/guix-daemon.conf | 74 | /etc/guix-daemon.conf |
diff --git a/configure.ac b/configure.ac index a9b1a728876..92dede80141 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -274,6 +274,7 @@ AC_CONFIG_FILES([Makefile | |||
| 274 | guix/config.scm]) | 274 | guix/config.scm]) |
| 275 | 275 | ||
| 276 | AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm]) | 276 | AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm]) |
| 277 | AC_CONFIG_FILES([etc/teams.scm], [chmod +x etc/teams.scm]) | ||
| 277 | AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env]) | 278 | AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env]) |
| 278 | AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], | 279 | AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], |
| 279 | [chmod +x pre-inst-env]) | 280 | [chmod +x pre-inst-env]) |
diff --git a/etc/teams.scm.in b/etc/teams.scm.in new file mode 100644 index 00000000000..f57177371dc --- /dev/null +++ b/etc/teams.scm.in | |||
| @@ -0,0 +1,257 @@ | |||
| 1 | #!@GUILE@ \ | ||
| 2 | --no-auto-compile -s | ||
| 3 | !# | ||
| 4 | |||
| 5 | ;;; GNU Guix --- Functional package management for GNU | ||
| 6 | ;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net> | ||
| 7 | ;;; | ||
| 8 | ;;; This file is part of GNU Guix. | ||
| 9 | ;;; | ||
| 10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | ||
| 11 | ;;; under the terms of the GNU General Public License as published by | ||
| 12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | ||
| 13 | ;;; your option) any later version. | ||
| 14 | ;;; | ||
| 15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | ||
| 16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;;; GNU General Public License for more details. | ||
| 19 | ;;; | ||
| 20 | ;;; You should have received a copy of the GNU General Public License | ||
| 21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | ;; This code defines development teams and team members. | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | (use-modules (srfi srfi-1) | ||
| 30 | (srfi srfi-9) | ||
| 31 | (ice-9 format) | ||
| 32 | (ice-9 match) | ||
| 33 | (guix ui)) | ||
| 34 | |||
| 35 | (define-record-type <team> | ||
| 36 | (make-team id name description members) | ||
| 37 | team? | ||
| 38 | (id team-id) | ||
| 39 | (name team-name) | ||
| 40 | (description team-description) | ||
| 41 | (members team-members set-team-members!)) | ||
| 42 | |||
| 43 | (define-record-type <person> | ||
| 44 | (make-person name email) | ||
| 45 | person? | ||
| 46 | (name person-name) | ||
| 47 | (email person-email)) | ||
| 48 | |||
| 49 | (define* (person name #:optional email) | ||
| 50 | (make-person name email)) | ||
| 51 | |||
| 52 | (define* (team id #:key name description (members '())) | ||
| 53 | (make-team id | ||
| 54 | (or name (symbol->string id)) | ||
| 55 | description | ||
| 56 | members)) | ||
| 57 | |||
| 58 | (define %teams | ||
| 59 | (make-hash-table)) | ||
| 60 | |||
| 61 | (define-syntax define-team | ||
| 62 | (lambda (x) | ||
| 63 | (syntax-case x () | ||
| 64 | ((_ id value) | ||
| 65 | #`(begin | ||
| 66 | (define-public id value) | ||
| 67 | (hash-set! %teams 'id id)))))) | ||
| 68 | |||
| 69 | (define-syntax-rule (define-member person teams ...) | ||
| 70 | (let ((p person)) | ||
| 71 | (for-each (lambda (team-id) | ||
| 72 | (let ((team | ||
| 73 | (hash-ref %teams team-id | ||
| 74 | (lambda () | ||
| 75 | (error (format #false | ||
| 76 | "Unknown team ~a for ~a~%" | ||
| 77 | team-id p)))))) | ||
| 78 | (set-team-members! | ||
| 79 | team (cons p (team-members team))))) | ||
| 80 | (quote (teams ...))))) | ||
| 81 | |||
| 82 | |||
| 83 | (define-team python | ||
| 84 | (team 'python | ||
| 85 | #:name "Python team" | ||
| 86 | #:description | ||
| 87 | "Python, Python packages, the \"pypi\" importer, and the python-build-system.")) | ||
| 88 | |||
| 89 | (define-team haskell | ||
| 90 | (team 'haskell | ||
| 91 | #:name "Haskell team" | ||
| 92 | #:description | ||
| 93 | "GHC, Hugs, Haskell packages, the \"hackage\" and \"stackage\" importers, and | ||
| 94 | the haskell-build-system.")) | ||
| 95 | |||
| 96 | (define-team r | ||
| 97 | (team 'r | ||
| 98 | #:name "R team" | ||
| 99 | #:description | ||
| 100 | "The R language, CRAN and Bioconductor repositories, the \"cran\" importer, | ||
| 101 | and the r-build-system.")) | ||
| 102 | |||
| 103 | (define-team julia | ||
| 104 | (team 'julia | ||
| 105 | #:name "Julia team" | ||
| 106 | #:description | ||
| 107 | "The Julia language, Julia packages, and the julia-build-system.")) | ||
| 108 | |||
| 109 | (define-team ocaml | ||
| 110 | (team 'ocaml | ||
| 111 | #:name "OCaml and Dune team" | ||
| 112 | #:description | ||
| 113 | "The OCaml language, the Dune build system, OCaml packages, the \"opam\" | ||
| 114 | importer, and the ocaml-build-system.")) | ||
| 115 | |||
| 116 | (define-team java | ||
| 117 | (team 'java | ||
| 118 | #:name "Java and Maven team" | ||
| 119 | #:description | ||
| 120 | "The JDK and JRE, the Maven build system, Java packages, the ant-build-system, | ||
| 121 | and the maven-build-system.")) | ||
| 122 | |||
| 123 | (define-team maths | ||
| 124 | (team 'maths | ||
| 125 | #:name "Algebra and Maths team")) | ||
| 126 | |||
| 127 | (define-team emacs | ||
| 128 | (team 'emacs | ||
| 129 | #:name "Emacs team")) | ||
| 130 | |||
| 131 | (define-team lisp | ||
| 132 | (team 'lisp | ||
| 133 | #:name "Lisp team")) | ||
| 134 | |||
| 135 | (define-team ruby | ||
| 136 | (team 'ruby | ||
| 137 | #:name "Ruby team")) | ||
| 138 | |||
| 139 | (define-team go | ||
| 140 | (team 'go | ||
| 141 | #:name "Go team")) | ||
| 142 | |||
| 143 | (define-team embedded-bootstrap | ||
| 144 | (team 'embedded-bootstrap | ||
| 145 | #:name "Embedded / Bootstrap")) | ||
| 146 | |||
| 147 | (define-team rust | ||
| 148 | (team 'rust | ||
| 149 | #:name "Rust")) | ||
| 150 | |||
| 151 | (define-team kernel | ||
| 152 | (team 'kernel | ||
| 153 | #:name "Linux-libre kernel team")) | ||
| 154 | |||
| 155 | (define-team core | ||
| 156 | (team 'core | ||
| 157 | #:name "Core / Tools / Internals")) | ||
| 158 | |||
| 159 | (define-team games | ||
| 160 | (team 'games | ||
| 161 | #:name "Games and Videos")) | ||
| 162 | |||
| 163 | (define-team translations | ||
| 164 | (team 'translations | ||
| 165 | #:name "Translations")) | ||
| 166 | |||
| 167 | (define-team installer | ||
| 168 | (team 'installer | ||
| 169 | #:name "Installer script and system installer")) | ||
| 170 | |||
| 171 | (define-team home | ||
| 172 | (team 'home | ||
| 173 | #:name "Team for \"guix home\"")) | ||
| 174 | |||
| 175 | (define-team mentors | ||
| 176 | (team 'mentors | ||
| 177 | #:name "Mentors" | ||
| 178 | #:description | ||
| 179 | "A group of mentors who chaperone contributions by newcomers.")) | ||
| 180 | |||
| 181 | |||
| 182 | (define-member (person "Ricardo Wurmus" | ||
| 183 | "rekado@elephly.net") | ||
| 184 | r core mentors) | ||
| 185 | |||
| 186 | (define-member (person "Ludovic Courtès" | ||
| 187 | "ludo@gnu.org") | ||
| 188 | core home embedded-bootstrap mentors) | ||
| 189 | |||
| 190 | |||
| 191 | |||
| 192 | (define (find-team name) | ||
| 193 | (or (hash-ref %teams (string->symbol name)) | ||
| 194 | (error (format #false | ||
| 195 | "no such team: ~a~%" name)))) | ||
| 196 | |||
| 197 | (define (cc . teams) | ||
| 198 | "Return arguments for `git send-email' to notify the members of the given | ||
| 199 | TEAMS when a patch is received by Debbugs." | ||
| 200 | (format #true | ||
| 201 | "~{--add-header=\"X-Debbugs-Cc: ~a\"~^ ~}" | ||
| 202 | (map person-email | ||
| 203 | (delete-duplicates (append-map team-members teams) equal?)))) | ||
| 204 | |||
| 205 | (define* (list-members team #:optional port (prefix "")) | ||
| 206 | "Print the members of the given TEAM." | ||
| 207 | (define port* (or port (current-output-port))) | ||
| 208 | (for-each | ||
| 209 | (lambda (member) | ||
| 210 | (format port* | ||
| 211 | "~a~a <~a>~%" | ||
| 212 | prefix | ||
| 213 | (person-name member) | ||
| 214 | (person-email member))) | ||
| 215 | (team-members team))) | ||
| 216 | |||
| 217 | (define (list-teams) | ||
| 218 | "Print all teams and their members." | ||
| 219 | (define port* (current-output-port)) | ||
| 220 | (define width* (%text-width)) | ||
| 221 | (hash-for-each | ||
| 222 | (lambda (key team) | ||
| 223 | (format port* | ||
| 224 | "\ | ||
| 225 | id: ~a | ||
| 226 | name: ~a | ||
| 227 | description: ~a | ||
| 228 | members: | ||
| 229 | " | ||
| 230 | (team-id team) | ||
| 231 | (team-name team) | ||
| 232 | (or (and=> (team-description team) | ||
| 233 | (lambda (text) | ||
| 234 | (string->recutils | ||
| 235 | (fill-paragraph text width* | ||
| 236 | (string-length "description: "))))) | ||
| 237 | "<none>")) | ||
| 238 | (list-members team port* "+ ") | ||
| 239 | (newline)) | ||
| 240 | %teams)) | ||
| 241 | |||
| 242 | (define (main . args) | ||
| 243 | (match args | ||
| 244 | (("cc" . team-names) | ||
| 245 | (apply cc (map find-team team-names))) | ||
| 246 | (("list-teams" . args) | ||
| 247 | (list-teams)) | ||
| 248 | (("list-members" . team-names) | ||
| 249 | (for-each | ||
| 250 | (lambda (team-name) | ||
| 251 | (list-members (find-team team-name))) | ||
| 252 | team-names)) | ||
| 253 | (anything | ||
| 254 | (format (current-error-port) | ||
| 255 | "Usage: etc/teams.scm <command> [<args>]~%")))) | ||
| 256 | |||
| 257 | (apply main (cdr (command-line))) | ||
