diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-07-16 11:40:34 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-07-19 11:48:04 +0200 |
commit | e529d46828c359b449fc570bdc293fc12534647c (patch) | |
tree | 2d6127bccc33d4f90baf8da1f6778dc5fadbd2e3 /tests | |
parent | 8df2eca6b0915942ea087d7c5981514c532d47a2 (diff) | |
download | guix-e529d46828c359b449fc570bdc293fc12534647c.tar guix-e529d46828c359b449fc570bdc293fc12534647c.tar.gz |
gexp: 'imported-files/derivation' can copy files instead of symlinking.
* guix/gexp.scm (imported-files/derivation): Add #:symlink? and honor
it.
(imported-files): Pass #:symlink? to 'imported-files/derivation'.
* tests/gexp.scm ("imported-files with file-like objects"): Add 'file=?'
and use it instead of calling 'readlink'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gexp.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index c89d0c4855..b22e635805 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -652,16 +652,19 @@ (files -> `(("a/b/c" . ,q-scm) ("p/q" . ,plain))) (drv (imported-files files))) + (define (file=? file1 file2) + ;; Assume deduplication is in place. + (= (stat:ino (lstat file1)) + (stat:ino (lstat file2)))) + (mbegin %store-monad (built-derivations (list drv)) (mlet %store-monad ((dir -> (derivation->output-path drv)) (plain* (text-file "foo" "bar!")) (q-scm* (interned-file q-scm "c"))) (return - (and (string=? (readlink (string-append dir "/a/b/c")) - q-scm*) - (string=? (readlink (string-append dir "/p/q")) - plain*))))))) + (and (file=? (string-append dir "/a/b/c") q-scm*) + (file=? (string-append dir "/p/q") plain*))))))) (test-equal "gexp-modules & ungexp" '((bar) (foo)) |