gexp: 'local-file' now defaults to non-recursive.

Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00235.html>.

* guix/gexp.scm (local-file): Change #:recursive? to default to #f.
* tests/gexp.scm ("one local file", "gexp->derivation, local-file"): Adjust
  calls to 'add-to-store' and 'interned-file' accordingly.
This commit is contained in:
Ludovic Courtès 2015-06-18 23:25:49 +02:00
parent b22755be95
commit 020f3e4156
2 changed files with 3 additions and 3 deletions

View file

@ -157,7 +157,7 @@ (define-record-type <local-file>
(recursive? local-file-recursive?)) ;Boolean (recursive? local-file-recursive?)) ;Boolean
(define* (local-file file #:optional (name (basename file)) (define* (local-file file #:optional (name (basename file))
#:key (recursive? #t)) #:key recursive?)
"Return an object representing local file FILE to add to the store; this "Return an object representing local file FILE to add to the store; this
object can be used in a gexp. FILE will be added to the store under NAME--by object can be used in a gexp. FILE will be added to the store under NAME--by
default the base name of FILE. default the base name of FILE.

View file

@ -101,7 +101,7 @@ (define-syntax-rule (test-assertm name exp)
(let* ((file (search-path %load-path "guix.scm")) (let* ((file (search-path %load-path "guix.scm"))
(local (local-file file)) (local (local-file file))
(exp (gexp (display (ungexp local)))) (exp (gexp (display (ungexp local))))
(intd (add-to-store %store (basename file) #t (intd (add-to-store %store (basename file) #f
"sha256" file))) "sha256" file)))
(and (gexp? exp) (and (gexp? exp)
(match (gexp-inputs exp) (match (gexp-inputs exp)
@ -360,7 +360,7 @@ (define (match-input thing)
(test-assertm "gexp->derivation, local-file" (test-assertm "gexp->derivation, local-file"
(mlet* %store-monad ((file -> (search-path %load-path "guix.scm")) (mlet* %store-monad ((file -> (search-path %load-path "guix.scm"))
(intd (interned-file file)) (intd (interned-file file #:recursive? #f))
(local -> (local-file file)) (local -> (local-file file))
(exp -> (gexp (begin (exp -> (gexp (begin
(stat (ungexp local)) (stat (ungexp local))