diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-01-06 22:25:29 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-01-06 22:25:29 +0100 |
| commit | 87236aed77bd57ecd143d84acf864fb112842118 (patch) | |
| tree | 77ebed23b8267ab621a69051ba60e58dfe715689 /tests/guix-archive.sh | |
| parent | b84612605204d604da84b30e56966994cc03d0a3 (diff) | |
archive: Add '--missing'.
* guix/scripts/archive.scm (show-help, %options): Add '--missing'.
(guix-archive)[lines]: New procedure.
Use it to honor '--missing'.
* tests/guix-archive.sh: Add tests.
* doc/guix.texi (Invoking guix archive): Document '--missing'.
Diffstat (limited to 'tests/guix-archive.sh')
| -rw-r--r-- | tests/guix-archive.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/guix-archive.sh b/tests/guix-archive.sh index 3ac618ae33c..0de7395145b 100644 --- a/tests/guix-archive.sh +++ b/tests/guix-archive.sh | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | # GNU Guix --- Functional package management for GNU | 1 | # GNU Guix --- Functional package management for GNU |
| 2 | # Copyright © 2013 Ludovic Courtès <ludo@gnu.org> | 2 | # Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> |
| 3 | # | 3 | # |
| 4 | # This file is part of GNU Guix. | 4 | # This file is part of GNU Guix. |
| 5 | # | 5 | # |
| @@ -44,5 +44,23 @@ guix archive --import < "$archive" 2>&1 | grep "import.*guile-bootstrap" | |||
| 44 | if guix archive something-that-does-not-exist | 44 | if guix archive something-that-does-not-exist |
| 45 | then false; else true; fi | 45 | then false; else true; fi |
| 46 | 46 | ||
| 47 | # This one must not be listed as missing. | ||
| 48 | guix build guile-bootstrap > "$archive" | ||
| 49 | guix archive --missing < "$archive" | ||
| 50 | test "`guix archive --missing < "$archive"`" = "" | ||
| 51 | |||
| 52 | # Two out of three should be listed as missing. | ||
| 53 | echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" >> "$archive" | ||
| 54 | echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive" | ||
| 55 | guix archive --missing < "$archive" > "$archive_alt" | ||
| 56 | echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" > "$archive" | ||
| 57 | echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive" | ||
| 58 | cmp "$archive" "$archive_alt" | ||
| 59 | |||
| 60 | # This is not a valid store file name, so an error. | ||
| 61 | echo something invalid > "$archive" | ||
| 62 | if guix archive --missing < "$archive" | ||
| 63 | then false; else true; fi | ||
| 64 | |||
| 47 | if echo foo | guix archive --authorize | 65 | if echo foo | guix archive --authorize |
| 48 | then false; else true; fi | 66 | then false; else true; fi |
