GNU bug report logs - #74979
[PATCH 0/4] scripts: style: Sort more kinds of package

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Thu, 19 Dec 2024 19:33:02 UTC

Severity: normal

Tags: moreinfo, patch

Full log


View this message in rfc822 format

From: Herman Rimm <herman <at> rimm.ee>
To: 74979 <at> debbugs.gnu.org
Cc: Christopher Baines <guix <at> cbaines.net>, Josselin Poiret <dev <at> jpoiret.xyz>, Ludovic Courtès <ludo <at> gnu.org>, Mathieu Othacehe <othacehe <at> gnu.org>, Simon Tournier <zimon.toutoune <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: [bug#74979] [PATCH 4/4] scripts: style: Warn about unmatched package definitions.
Date: Thu, 19 Dec 2024 20:33:07 +0100
* guix/scripts/style.scm (order-packages): Warn.

Change-Id: Iddbf979ee9ee5ed1ebada63776a390db024154fa
---
 guix/scripts/style.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 4801529f7e..81fe1141e2 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -508,9 +508,15 @@ (define (order-packages lst)
          (((or 'package 'package/inherit) fields ...)
           (let ((name (and=> (assoc-ref fields 'name) first))
                 (version (and=> (assoc-ref fields 'version) first)))
+            (if (and name version)
+                (unless (and (string? name) (string? version))
+                  (warning (G_ "non-string name/version for ~a~%") pkg))
+                (warning (G_ "package fields not found for ~a~%") pkg))
             (values name version)))
-         (_ (and (values #f #f)))))
-      (_ (and (values #f #f)))))
+         (_ (and (warning (G_ "package record missing for ~a~%") pkg)
+                 (values #f #f)))))
+      (_ (and (info (G_ "not sorting top-level S-exp.: ~a~%") pkg)
+              (values #f #f)))))
 
   (define (package>? lst1 lst2)
     (let-values (((name1 version1) (package-fields lst1))
-- 
2.45.2





This bug report was last modified 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.