diff options
author | Herman Rimm <herman@rimm.ee> | 2024-05-05 19:25:33 +0200 |
---|---|---|
committer | Guix Patches Tester <> | 2024-05-05 20:33:57 +0200 |
commit | 74179ee6d7baddd158ca6fa0e2709857415379b5 (patch) | |
tree | 704204a702d2820a57e3edc93ff7ac13cd2fe8f5 | |
parent | da9f509b0300f1b6b979c68a52d8669f9bcb89a7 (diff) | |
download | guix-patches-74179ee6d7baddd158ca6fa0e2709857415379b5.tar guix-patches-74179ee6d7baddd158ca6fa0e2709857415379b5.tar.gz |
guix: Move ‘package-location<?’ to (guix packages).
* guix/scripts/style.scm (package-location<?): Move to…
* guix/packages.scm (package-location<?): … here.
Change-Id: I8ebb37c261a1bb3fa5772177b27fd62a2553e318
-rw-r--r-- | guix/packages.scm | 11 | ||||
-rw-r--r-- | guix/scripts/style.scm | 9 |
2 files changed, 11 insertions, 9 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index abe89cdb07..b9d49f9069 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -116,6 +116,8 @@ deprecated-package package-field-location + package-location<? + this-package-input this-package-native-input @@ -816,6 +818,15 @@ object." #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 @@ bailing out~%")) #: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. |