scripts: style: Only sort packages with string literal name.

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

Change-Id: I48a5976930501c20415b5413966b5294958bc23b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Herman Rimm 2025-01-21 22:43:02 +01:00 committed by Ludovic Courtès
parent 6ad2e407eb
commit c346614c3e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -515,11 +515,13 @@ share a name are placed with versions in descending order."
(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)