summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/kernels-manifest.scm33
-rw-r--r--etc/teams.scm.in40
2 files changed, 69 insertions, 4 deletions
diff --git a/etc/kernels-manifest.scm b/etc/kernels-manifest.scm
new file mode 100644
index 0000000000..6da7e374c5
--- /dev/null
+++ b/etc/kernels-manifest.scm
@@ -0,0 +1,33 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Leo Famulari <leo@famulari.name>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+;;; This file returns a manifest of packages related to linux-libre.
+;;; Simplistically, it selects packages whose names begin with "linux-libre".
+;;; It is used to assist continuous integration of the kernel packages.
+
+(use-modules (guix packages))
+
+(manifest
+ (map package->manifest-entry
+ (fold-packages
+ (lambda (package lst)
+ (if (string-prefix? "linux-libre"
+ (package-name package))
+ (cons package lst)
+ lst))
+ '())))
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index f42a7f6f28..96a04aca3d 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 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -34,6 +35,7 @@
(ice-9 format)
(ice-9 regex)
(ice-9 match)
+ (ice-9 rdelim)
(guix ui)
(git))
@@ -623,14 +625,38 @@ and REV-END, two git revision strings."
(const 0))
files))
+(define (git-patch->commit-id file)
+ "Parse the commit ID from the first line of FILE, a patch produced with git."
+ (call-with-input-file file
+ (lambda (port)
+ (let ((m (string-match "^From ([0-9a-f]{40})" (read-line port))))
+ (unless m
+ (error "invalid patch file:" file))
+ (match:substring m 1)))))
+
+(define (git-patch->revisions file)
+ "Return the start and end revisions of FILE, a patch file produced with git."
+ (let* ((rev-end (git-patch->commit-id file))
+ (rev-start (string-append rev-end "^")))
+ (list rev-start rev-end)))
+
(define (main . args)
(match args
(("cc" . team-names)
(apply cc (map find-team team-names)))
+ (("cc-members" patch-file)
+ (unless (file-exists? patch-file)
+ (error "patch file does not exist:" patch-file))
+ (apply main "cc-members" (git-patch->revisions patch-file)))
(("cc-members" rev-start rev-end)
(apply cc (find-team-by-scope
(diff-revisions rev-start rev-end))))
+ (("get-maintainer" patch-file)
+ (apply main "list-members"
+ (map (compose symbol->string team-id)
+ (find-team-by-scope (apply diff-revisions
+ (git-patch->revisions patch-file))))))
(("list-teams" . args)
(list-teams))
(("list-members" . team-names)
@@ -643,9 +669,15 @@ and REV-END, two git revision strings."
"Usage: etc/teams.scm <command> [<args>]
Commands:
- 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>~%"))))
+ cc <team-name>
+ get git send-email flags for cc-ing <team-name>
+ cc-members <start> <end> | patch
+ cc teams related to files changed between revisions or in a patch file
+ list-teams
+ list teams and their members
+ list-members <team-name>
+ list members belonging to <team-name>
+ get-maintainer <patch>
+ compatibility mode with Linux get_maintainer.pl~%"))))
(apply main (cdr (command-line)))