@@ -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
@@ -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.