guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#74979] [PATCH 3/4] scripts: style: Only sort packages with string l


From: Herman Rimm
Subject: [bug#74979] [PATCH 3/4] scripts: style: Only sort packages with string literal name.
Date: Thu, 19 Dec 2024 20:33:06 +0100

* guix/scripts/style.scm (order-packages): Only match string literals.

Change-Id: I48a5976930501c20415b5413966b5294958bc23b
---
 guix/scripts/style.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 6f07f6c3b9..4801529f7e 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -515,11 +515,13 @@ (define (order-packages lst)
   (define (package>? lst1 lst2)
     (let-values (((name1 version1) (package-fields lst1))
                  ((name2 version2) (package-fields lst2)))
-      (and name1 name2 (or (string>? name1 name2)
-                           (and (string=? name1 name2)
-                                version1
-                                version2
-                                (version>? version2 version1))))))
+      (and (string? name1)
+           (string? name2)
+           (or (string>? name1 name2)
+               (and (string=? name1 name2)
+                    (string? version1)
+                    (string? version2)
+                    (version>? version2 version1))))))
 
         ;; Group define-public with preceding blanks and defines.
   (let ((lst (fold2 (lambda (expr tail head)
-- 
2.45.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]