From c6f8e9dd64feb1ad174201277cf2ad0784f7d001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 19 Oct 2015 10:09:28 +0200 Subject: guix archive: Add '--extract'. * guix/scripts/archive.scm (show-help, %options): Add --extract. (guix-archive): Honor it. * tests/guix-archive.sh: Test it. * doc/guix.texi (Invoking guix archive): Document it. --- tests/guix-archive.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/guix-archive.sh b/tests/guix-archive.sh index 8eacf89338..fdaeb98ad2 100644 --- a/tests/guix-archive.sh +++ b/tests/guix-archive.sh @@ -24,9 +24,11 @@ guix archive --version archive="t-archive-$$" archive_alt="t-archive-alt-$$" +tmpdir="t-archive-dir-$$" rm -f "$archive" "$archive_alt" +rm -rf "$tmpdir" -trap 'rm -f "$archive" "$archive_alt"' EXIT +trap 'rm -f "$archive" "$archive_alt"; rm -rf "$tmpdir"' EXIT guix archive --export guile-bootstrap > "$archive" guix archive --export guile-bootstrap:out > "$archive_alt" @@ -39,7 +41,7 @@ cmp "$archive" "$archive_alt" guix archive --export `guix build guile-bootstrap` > "$archive_alt" cmp "$archive" "$archive_alt" -# Check the exit value and stderr upon import. +# Check the exit value upon import. guix archive --import < "$archive" if guix archive something-that-does-not-exist @@ -63,5 +65,14 @@ echo something invalid > "$archive" if guix archive --missing < "$archive" then false; else true; fi +# Check '--extract'. +guile -c "(use-modules (guix serialization)) + (call-with-output-file \"$archive\" + (lambda (port) + (write-file \"$(guix build guile-bootstrap)\" port)))" +guix archive -x "$tmpdir" < "$archive" +test -x "$tmpdir/bin/guile" +test -d "$tmpdir/lib/guile" + if echo foo | guix archive --authorize then false; else true; fi -- cgit v1.2.3