GNU bug report logs - #70499
[PATCH] utils: Add find-unordered-packages procedure.

Previous Next

Package: guix-patches;

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

Date: Sun, 21 Apr 2024 18:01:12 UTC

Severity: normal

Tags: patch

Full log


Message #20 received at 70499 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70499 <at> debbugs.gnu.org
Subject: [PATCH v2 1/3] guix: Move ‘package-location<?’ to (guix packages).
Date: Sun,  5 May 2024 19:25:33 +0200
* guix/scripts/style.scm (package-location<?): Move to…
* guix/packages.scm (package-location<?): … here.

Change-Id: I8ebb37c261a1bb3fa5772177b27fd62a2553e318
---
 guix/packages.scm      | 11 +++++++++++
 guix/scripts/style.scm |  9 ---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 4385e4f930..d878cc071e 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -116,6 +116,8 @@ (define-module (guix packages)
             deprecated-package
             package-field-location
 
+            package-location<?
+
             this-package-input
             this-package-native-input
 
@@ -815,6 +817,15 @@ (define (package-field-location package field)
         #f)))
     (_ #f)))
 
+(define (package-location<? p1 p2)
+  "Return true if P1's location is \"before\" P2's."
+  (let ((loc1 (package-location p1))
+        (loc2 (package-location p2)))
+    (and loc1 loc2
+         (if (string=? (location-file loc1) (location-file loc2))
+             (< (location-line loc1) (location-line loc2))
+             (string<? (location-file loc1) (location-file loc2))))))
+
 (define-syntax-rule (this-package-input name)
   "Return the input NAME of the package being defined--i.e., an input
 from the ‘inputs’ or ‘propagated-inputs’ field.  Native inputs are not
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm
index 211980dc1c..534034b271 100644
--- a/guix/scripts/style.scm
+++ b/guix/scripts/style.scm
@@ -480,15 +480,6 @@ (define* (format-package-definition package
                         #:format-comment canonicalize-comment
                         #:format-vertical-space canonicalize-vertical-space)))))
 
-(define (package-location<? p1 p2)
-  "Return true if P1's location is \"before\" P2's."
-  (let ((loc1 (package-location p1))
-        (loc2 (package-location p2)))
-    (and loc1 loc2
-         (if (string=? (location-file loc1) (location-file loc2))
-             (< (location-line loc1) (location-line loc2))
-             (string<? (location-file loc1) (location-file loc2))))))
-
 
 ;;;
 ;;; Whole-file formatting.
-- 
2.41.0





This bug report was last modified 345 days ago.

Previous Next


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