summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2019-05-21 14:33:51 +0200
committerLudovic Courtès <ludo@gnu.org>2019-05-22 00:09:41 +0200
commitfd214f1522063905021a297dab1ac4d85d94ad83 (patch)
tree473c4fec2a8d40de2326dda81871c7fa62425068 /tests
parent6acf6cec7d74d2e288e275429e8362bfb04b0286 (diff)
downloadpatches-fd214f1522063905021a297dab1ac4d85d94ad83.tar
patches-fd214f1522063905021a297dab1ac4d85d94ad83.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-pack.sh11
1 files changed, 9 insertions, 2 deletions
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