From 020f3e41568d4f76544e3e1c10e1d8dd4effc424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 18 Jun 2015 23:25:49 +0200 Subject: gexp: 'local-file' now defaults to non-recursive. Reported by Alex Kost at . * 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. --- tests/gexp.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index 7e14073fd4..fee7d87d00 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -101,7 +101,7 @@ (let* ((file (search-path %load-path "guix.scm")) (local (local-file file)) (exp (gexp (display (ungexp local)))) - (intd (add-to-store %store (basename file) #t + (intd (add-to-store %store (basename file) #f "sha256" file))) (and (gexp? exp) (match (gexp-inputs exp) @@ -360,7 +360,7 @@ (test-assertm "gexp->derivation, local-file" (mlet* %store-monad ((file -> (search-path %load-path "guix.scm")) - (intd (interned-file file)) + (intd (interned-file file #:recursive? #f)) (local -> (local-file file)) (exp -> (gexp (begin (stat (ungexp local)) -- cgit v1.2.3 From 7833db1f30d78aea3b7cb042723c2bd7d00e64ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 19 Jun 2015 10:18:44 +0200 Subject: gexp: 'local-file' canonicalizes its file argument. Reported by Alex Kost at . * guix/gexp.scm (local-file): Add call to 'canonicalize-path'. * tests/gexp.scm ("one local file, symlink"): New test. --- tests/gexp.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index fee7d87d00..32031663f5 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -109,6 +109,25 @@ (eq? x local))) (equal? `(display ,intd) (gexp->sexp* exp))))) +(test-assert "one local file, symlink" + (let ((file (search-path %load-path "guix.scm")) + (link (tmpnam))) + (dynamic-wind + (const #t) + (lambda () + (symlink (canonicalize-path file) link) + (let* ((local (local-file link "my-file" #:recursive? #f)) + (exp (gexp (display (ungexp local)))) + (intd (add-to-store %store "my-file" #f + "sha256" file))) + (and (gexp? exp) + (match (gexp-inputs exp) + (((x "out")) + (eq? x local))) + (equal? `(display ,intd) (gexp->sexp* exp))))) + (lambda () + (false-if-exception (delete-file link)))))) + (test-assert "one plain file" (let* ((file (plain-file "hi" "Hello, world!")) (exp (gexp (display (ungexp file)))) -- cgit v1.2.3