From 9d3994f70095b46b95e6d05562f32c25be326772 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 14 Dec 2015 19:52:47 +0100 Subject: gexp: 'local-file' resolves relative file names. * guix/gexp.scm (): Rename constructor to '%%local-file'. Add 'absolute' field. (%local-file, extract-directory, absolute-file-name): New procedures. (current-source-directory): New macro. (local-file): Adjust call to '%local-file'. (local-file-absolute-file-name): New procedure. (local-file-compiler): Force the 'absolute' field. * tests/guix-system.sh: Test whether 'local-file' canonicalization works. * doc/guix.texi (G-Expressions): Adjust. --- tests/guix-system.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/guix-system.sh b/tests/guix-system.sh index e20bc98713..02e2524d9e 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see . # -# Test the daemon and its interaction with 'guix substitute'. +# Test 'guix system', mostly error reporting. # set -e @@ -26,7 +26,15 @@ guix system --version tmpfile="t-guix-system-$$" errorfile="t-guix-system-error-$$" -trap 'rm -f "$tmpfile" "$errorfile"' EXIT + +# Note: This directory is chosen outside $builddir so that relative file name +# canonicalization doesn't mess up with 'current-source-directory', used by +# 'local-file' ('load' forces 'relative' for +# %FILE-PORT-NAME-CANONICALIZATION.) +tmpdir="${TMPDIR:-/tmp}/t-guix-system-$$" +mkdir "$tmpdir" + +trap 'rm -f "$tmpfile" "$errorfile" "$tmpdir"/*; rmdir "$tmpdir"' EXIT # Reporting of syntax errors. @@ -180,3 +188,23 @@ make_user_config "users" "group-that-does-not-exist" if guix system build "$tmpfile" -n 2> "$errorfile" then false else grep "supplementary group.*group-that-does-not-exist.*undeclared" "$errorfile"; fi + +# Try 'local-file' and relative file name resolution. + +cat > "$tmpdir/config.scm"< "$tmpdir/my-torrc"<