[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
67/68: committer: Avoid // in xpath.
From: |
guix-commits |
Subject: |
67/68: committer: Avoid // in xpath. |
Date: |
Mon, 26 Aug 2024 05:45:49 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit a7db59b3fd217374d1da821a51f53c987e9c96a3
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Sun Aug 25 22:35:47 2024 +0200
committer: Avoid // in xpath.
When using // we assume that the package definition's S-expression is a
nesting of proper lists. This is not guaranteed to be true, because a
package
definition may contain alists. By using an explicit path to the field of
interest we avoid recursion through all child nodes, thus avoiding child
nodes
that are more likely to contain improper lists.
* etc/committer.scm.in (change-commit-message): Replace // with a path for
the
PACKAGE symbol.
Change-Id: Idefaec9f5c3538484432e15a5865a68fc16e7369
---
etc/committer.scm.in | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index 0705b29fd9..c49935da60 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -3,7 +3,7 @@
!#
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -255,10 +255,18 @@ corresponding to the top-level definition containing the
staged changes."
(define* (change-commit-message file-name old new #:optional (port
(current-output-port)))
"Print ChangeLog commit message for changes between OLD and NEW."
(define (get-values expr field)
- (match ((xpath:sxpath `(// ,field quasiquote *)) expr)
+ (match ((xpath:node-or
+ (xpath:sxpath `(*any* *any* package ,field quasiquote *))
+ ;; For let binding
+ (xpath:sxpath `(*any* *any* (*any*) package ,field quasiquote *)))
+ (cons '*TOP* expr))
(()
;; New-style plain lists
- (match ((xpath:sxpath `(// ,field list *)) expr)
+ (match ((xpath:node-or
+ (xpath:sxpath `(*any* *any* package ,field list *))
+ ;; For let binding
+ (xpath:sxpath `(*any* *any* (*any*) package ,field list *)))
+ (cons '*TOP* expr))
((inner) inner)
(_ '())))
;; Old-style labelled inputs
@@ -275,7 +283,11 @@ corresponding to the top-level definition containing the
staged changes."
(define variable-name
(second old))
(define version
- (and=> ((xpath:sxpath '(// version *any*)) new)
+ (and=> ((xpath:node-or
+ (xpath:sxpath '(*any* *any* package version *any*))
+ ;; For let binding
+ (xpath:sxpath '(*any* *any* (*any*) package version *any*)))
+ (cons '*TOP* new))
first))
(format port
"gnu: ~a: Update to ~a.~%~%* ~a (~a): Update to ~a.~%"
- 42/68: gnu: r-bdgraph: Update to 2.73., (continued)
- 42/68: gnu: r-bdgraph: Update to 2.73., guix-commits, 2024/08/26
- 44/68: gnu: r-spatstat-utils: Update to 3.1-0., guix-commits, 2024/08/26
- 39/68: gnu: r-caretensemble: Update to 4.0.0., guix-commits, 2024/08/26
- 47/68: gnu: r-qtl: Update to 1.70., guix-commits, 2024/08/26
- 46/68: gnu: r-hunspell: Update to 3.0.4., guix-commits, 2024/08/26
- 50/68: gnu: r-webutils: Update to 1.2.1., guix-commits, 2024/08/26
- 53/68: gnu: r-digest: Update to 0.6.37., guix-commits, 2024/08/26
- 49/68: gnu: r-intervals: Update to 0.15.5., guix-commits, 2024/08/26
- 63/68: gnu: r-minqa: Update to 1.2.8., guix-commits, 2024/08/26
- 54/68: gnu: r-rmarkdown: Update to 2.28., guix-commits, 2024/08/26
- 67/68: committer: Avoid // in xpath.,
guix-commits <=
- 56/68: gnu: r-sfsmisc: Update to 1.1-19., guix-commits, 2024/08/26
- 60/68: gnu: r-pcapp: Update to 2.0-5., guix-commits, 2024/08/26