summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-01-06 22:25:29 +0100
committerLudovic Courtès <ludo@gnu.org>2014-01-06 22:25:29 +0100
commit87236aed77bd57ecd143d84acf864fb112842118 (patch)
tree77ebed23b8267ab621a69051ba60e58dfe715689 /tests
parentb84612605204d604da84b30e56966994cc03d0a3 (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')
-rw-r--r--tests/guix-archive.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/guix-archive.sh b/tests/guix-archive.sh
index 3ac618ae33..0de7395145 100644
--- a/tests/guix-archive.sh
+++ b/tests/guix-archive.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -44,5 +44,23 @@ guix archive --import < "$archive" 2>&1 | grep "import.*guile-bootstrap"
if guix archive something-that-does-not-exist
then false; else true; fi
+# This one must not be listed as missing.
+guix build guile-bootstrap > "$archive"
+guix archive --missing < "$archive"
+test "`guix archive --missing < "$archive"`" = ""
+
+# Two out of three should be listed as missing.
+echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" >> "$archive"
+echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
+guix archive --missing < "$archive" > "$archive_alt"
+echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" > "$archive"
+echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
+cmp "$archive" "$archive_alt"
+
+# This is not a valid store file name, so an error.
+echo something invalid > "$archive"
+if guix archive --missing < "$archive"
+then false; else true; fi
+
if echo foo | guix archive --authorize
then false; else true; fi