diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-10-19 10:09:28 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-19 10:10:47 +0200 |
| commit | c6f8e9dd64feb1ad174201277cf2ad0784f7d001 (patch) | |
| tree | 2046cef1ef26ec458c0831fd6ee6156921528350 /tests | |
| parent | 1d19bc11620dd0421569712748262f5c411342f8 (diff) | |
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.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/guix-archive.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/guix-archive.sh b/tests/guix-archive.sh index 8eacf89338d..fdaeb98ad2b 100644 --- a/tests/guix-archive.sh +++ b/tests/guix-archive.sh | |||
| @@ -24,9 +24,11 @@ guix archive --version | |||
| 24 | 24 | ||
| 25 | archive="t-archive-$$" | 25 | archive="t-archive-$$" |
| 26 | archive_alt="t-archive-alt-$$" | 26 | archive_alt="t-archive-alt-$$" |
| 27 | tmpdir="t-archive-dir-$$" | ||
| 27 | rm -f "$archive" "$archive_alt" | 28 | rm -f "$archive" "$archive_alt" |
| 29 | rm -rf "$tmpdir" | ||
| 28 | 30 | ||
| 29 | trap 'rm -f "$archive" "$archive_alt"' EXIT | 31 | trap 'rm -f "$archive" "$archive_alt"; rm -rf "$tmpdir"' EXIT |
| 30 | 32 | ||
| 31 | guix archive --export guile-bootstrap > "$archive" | 33 | guix archive --export guile-bootstrap > "$archive" |
| 32 | guix archive --export guile-bootstrap:out > "$archive_alt" | 34 | guix archive --export guile-bootstrap:out > "$archive_alt" |
| @@ -39,7 +41,7 @@ cmp "$archive" "$archive_alt" | |||
| 39 | guix archive --export `guix build guile-bootstrap` > "$archive_alt" | 41 | guix archive --export `guix build guile-bootstrap` > "$archive_alt" |
| 40 | cmp "$archive" "$archive_alt" | 42 | cmp "$archive" "$archive_alt" |
| 41 | 43 | ||
| 42 | # Check the exit value and stderr upon import. | 44 | # Check the exit value upon import. |
| 43 | guix archive --import < "$archive" | 45 | guix archive --import < "$archive" |
| 44 | 46 | ||
| 45 | if guix archive something-that-does-not-exist | 47 | if guix archive something-that-does-not-exist |
| @@ -63,5 +65,14 @@ echo something invalid > "$archive" | |||
| 63 | if guix archive --missing < "$archive" | 65 | if guix archive --missing < "$archive" |
| 64 | then false; else true; fi | 66 | then false; else true; fi |
| 65 | 67 | ||
| 68 | # Check '--extract'. | ||
| 69 | guile -c "(use-modules (guix serialization)) | ||
| 70 | (call-with-output-file \"$archive\" | ||
| 71 | (lambda (port) | ||
| 72 | (write-file \"$(guix build guile-bootstrap)\" port)))" | ||
| 73 | guix archive -x "$tmpdir" < "$archive" | ||
| 74 | test -x "$tmpdir/bin/guile" | ||
| 75 | test -d "$tmpdir/lib/guile" | ||
| 76 | |||
| 66 | if echo foo | guix archive --authorize | 77 | if echo foo | guix archive --authorize |
| 67 | then false; else true; fi | 78 | then false; else true; fi |
