summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-01-07 13:55:32 +0100
committerLudovic Courtès <ludo@gnu.org>2019-01-07 14:41:00 +0100
commit54ddb6a154082ecd41d50236d49a267697ff0f4e (patch)
tree4186db0a9f92960a679e9facc848ea73c84983b9 /guix
parent46cf4cd6766d0a7186af513d33def5637ea8529c (diff)
lint: Avoid 'dirname' call at the top level.
* guix/scripts/lint.scm (%distro-directory): Wrap in 'mlambda'. (check-patch-file-names): Adjust accordingly.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/lint.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 040480c1ac..9acec48577 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -595,7 +595,8 @@ from ~a")
'home-page)))))
(define %distro-directory
- (dirname (search-path %load-path "gnu.scm")))
+ (mlambda ()
+ (dirname (search-path %load-path "gnu.scm"))))
(define (check-patch-file-names package)
"Emit a warning if the patches requires by PACKAGE are badly named or if the
@@ -620,12 +621,12 @@ patch could not be found."
'patch-file-names))
;; Check whether we're reaching tar's maximum file name length.
- (let ((prefix (string-length %distro-directory))
+ (let ((prefix (string-length (%distro-directory)))
(margin (string-length "guix-0.13.0-10-123456789/"))
(max 99))
(for-each (match-lambda
((? string? patch)
- (when (> (+ margin (if (string-prefix? %distro-directory
+ (when (> (+ margin (if (string-prefix? (%distro-directory)
patch)
(- (string-length patch) prefix)
(string-length patch)))