guix_mirror_bot pushed a commit to branch master
in repository guix.

commit efdc2d0ad82901fceb19d8ab9b1dfac8368e8ab6
Author: Martin Schitter <[email protected]>
AuthorDate: Mon Oct 20 15:07:27 2025 +0000

    etc: committer: Fix crashes on missing package version fields.
    
    * etc/committer.scm.in (change-commit-message):
    Fix handling of missing package version fields.
    
    Change-Id: Id6565dc30a25f6bd53ba2c1f82609a357c375d8c
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 etc/committer.scm.in | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index 7bc07f3c88..5a6532fd72 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -283,15 +283,20 @@ corresponding to the top-level definition containing the 
staged changes."
   (define variable-name
     (second old))
   (define version
-    (and=> ((xpath:node-or
+    (match ((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.~%"
-          variable-name version file-name variable-name version)
+      (() #f)
+      ((version . rest) version)))
+  (if version
+      (format port
+              "gnu: ~a: Update to ~a.~%~%* ~a (~a): Update to ~a.~%"
+              variable-name version file-name variable-name version)
+      (format port
+              "gnu: ~a: Update.~%~%* ~a (~a): Update.~%"
+              variable-name file-name variable-name))
   (for-each (lambda (field)
               (let ((old-values (get-values old field))
                     (new-values (get-values new field)))

Reply via email to