store: Really disable file name canonicalization for derivation inputs.

* guix/store.scm (write-contents)[call-with-binary-input-file]: Set
  %FILE-PORT-NAME-CANONICALIZATION to #f.
* gnu/packages.scm (search-patch, search-bootstrap-binary): Leave
  %FILE-PORT-NAME-CANONICALIZATION unchanged.  This reverts 9776ebb.
This commit is contained in:
Ludovic Courtès 2013-03-22 22:58:19 +01:00
parent 238f739777
commit 128663e4c8
2 changed files with 11 additions and 11 deletions

View File

@ -61,14 +61,12 @@
(define (search-patch file-name) (define (search-patch file-name)
"Search the patch FILE-NAME." "Search the patch FILE-NAME."
(with-fluids ((%file-port-name-canonicalization #f)) (search-path (%patch-path) file-name))
(search-path (%patch-path) file-name)))
(define (search-bootstrap-binary file-name system) (define (search-bootstrap-binary file-name system)
"Search the bootstrap binary FILE-NAME for SYSTEM." "Search the bootstrap binary FILE-NAME for SYSTEM."
(with-fluids ((%file-port-name-canonicalization #f)) (search-path (%bootstrap-binaries-path)
(search-path (%bootstrap-binaries-path) (string-append system "/" file-name)))
(string-append system "/" file-name))))
(define %distro-module-directory (define %distro-module-directory
;; Absolute path of the (gnu packages ...) module root. ;; Absolute path of the (gnu packages ...) module root.

View File

@ -238,12 +238,14 @@
"Write SIZE bytes from FILE to output port P." "Write SIZE bytes from FILE to output port P."
(define (call-with-binary-input-file file proc) (define (call-with-binary-input-file file proc)
;; Open FILE as a binary file. This avoids scan-for-encoding, and thus ;; Open FILE as a binary file. This avoids scan-for-encoding, and thus
;; avoids any initial buffering. ;; avoids any initial buffering. Disable file name canonicalization to
(let ((port (open-file file "rb"))) ;; avoid stat'ing like crazy.
(catch #t (cut proc port) (with-fluids ((%file-port-name-canonicalization #f))
(lambda args (let ((port (open-file file "rb")))
(close-port port) (catch #t (cut proc port)
(apply throw args))))) (lambda args
(close-port port)
(apply throw args))))))
(define (dump in size) (define (dump in size)
(define buf-size 65536) (define buf-size 65536)