diff options
-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. |