From c346614c3e1bb9fea74185200240a97670834592 Mon Sep 17 00:00:00 2001 From: Herman Rimm Date: Tue, 21 Jan 2025 22:43:02 +0100 Subject: [PATCH] scripts: style: Only sort packages with string literal name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/style.scm (order-packages): Only match string literals. Change-Id: I48a5976930501c20415b5413966b5294958bc23b Signed-off-by: Ludovic Courtès --- 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 6f07f6c3b9e..4801529f7e9 100644 --- a/guix/scripts/style.scm +++ b/guix/scripts/style.scm @@ -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)