diff options
author | Marius Bakke <mbakke@fastmail.com> | 2020-03-21 22:16:02 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2020-03-21 22:16:02 +0100 |
commit | d19b14c8349ce8cacb62619ab68953265daeeca7 (patch) | |
tree | 9aacc6f9378ca69951c87232b3a7526fef2f2054 /guix/packages.scm | |
parent | 680b56116a4840a281a45cb130fd45d6d3d46c56 (diff) | |
parent | ee4c927f33a1d3b01cf36be3c74227f6b7fd69ff (diff) | |
download | guix-patches-d19b14c8349ce8cacb62619ab68953265daeeca7.tar guix-patches-d19b14c8349ce8cacb62619ab68953265daeeca7.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/packages.scm')
-rw-r--r-- | guix/packages.scm | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index d925e754a3..5c6d1a92d5 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -355,25 +355,24 @@ object." (catch 'system-error (lambda () ;; In general we want to keep relative file names for modules. - (with-fluids ((%file-port-name-canonicalization 'relative)) - (call-with-input-file (search-path %load-path file) - (lambda (port) - (goto port line column) - (match (read port) - (('package inits ...) - (let ((field (assoc field inits))) - (match field - ((_ value) - ;; Put the `or' here, and not in the first argument of - ;; `and=>', to work around a compiler bug in 2.0.5. - (or (and=> (source-properties value) - source-properties->location) - (and=> (source-properties field) - source-properties->location))) - (_ - #f)))) - (_ - #f)))))) + (call-with-input-file (search-path %load-path file) + (lambda (port) + (goto port line column) + (match (read port) + (('package inits ...) + (let ((field (assoc field inits))) + (match field + ((_ value) + (let ((props (source-properties value))) + (and props + ;; Preserve the original file name, which may be a + ;; relative file name. + (let ((loc (source-properties->location props))) + (set-field loc (location-file) file))))) + (_ + #f)))) + (_ + #f))))) (lambda _ #f))) (_ #f))) |