From fd214f1522063905021a297dab1ac4d85d94ad83 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 21 May 2019 14:33:51 +0200 Subject: pack: Add '--root'. * guix/scripts/pack.scm (%options, show-help): Add "--root". (guix-pack): Honor it. * tests/guix-pack.sh: Test it. * doc/guix.texi (Invoking guix pack): Document it. --- tests/guix-pack.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh index 3cd0404748..0feae6d1e8 100644 --- a/tests/guix-pack.sh +++ b/tests/guix-pack.sh @@ -33,6 +33,9 @@ guix pack --version GUIX_BUILD_OPTIONS="--no-substitutes" export GUIX_BUILD_OPTIONS +test_directory="`mktemp -d`" +trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT + # Build a tarball with no compression. guix pack --compression=none --bootstrap guile-bootstrap @@ -42,14 +45,18 @@ out2="`guix pack --bootstrap -e '(@ (gnu packages bootstrap) %bootstrap-guile)'` test -n "$out1" test "$out1" = "$out2" +# Test '--root'. +guix pack -r "$test_directory/my-guile" --bootstrap guile-bootstrap +test "`readlink "$test_directory/my-guile"`" = "$out1" +guix gc --list-roots | grep "^$test_directory/my-guile$" +rm "$test_directory/my-guile" + # Build a tarball with a symlink. the_pack="`guix pack --bootstrap -S /opt/gnu/bin=bin guile-bootstrap`" # Try to extract it. Note: we cannot test whether /opt/gnu/bin/guile itself # exists because /opt/gnu/bin may be an absolute symlink to a store item that # has been GC'd. -test_directory="`mktemp -d`" -trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT cd "$test_directory" tar -xf "$the_pack" test -L opt/gnu/bin -- cgit v1.2.3