[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/05: challenge: Really exit with non-zero upon hash mismatch.
From: |
Ludovic Courtès |
Subject: |
02/05: challenge: Really exit with non-zero upon hash mismatch. |
Date: |
Wed, 06 Apr 2016 21:29:09 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 7cffaeb60473e25a7ef8c1a8cb36e1531191873a
Author: Ludovic Courtès <address@hidden>
Date: Wed Apr 6 23:19:00 2016 +0200
challenge: Really exit with non-zero upon hash mismatch.
Reported by John Darrington.
* guix/scripts/challenge.scm (guix-challenge): Add an explicit 'exit'
call when ISSUES is empty.
* scripts/guix.in: Add comment about 'exit'.
* doc/guix.texi (Invoking guix challenge): Mention the behavior and exit
code.
---
doc/guix.texi | 7 ++++++-
guix/scripts/challenge.scm | 4 +++-
scripts/guix.in | 5 +++++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index aeeec61..a164222 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5582,7 +5582,7 @@ $ guix challenge @var{package}
@noindent
where @var{package} is a package specification such as
address@hidden or @code{glibc:debug}.
address@hidden@@2.0} or @code{glibc:debug}.
The general syntax is:
@@ -5590,6 +5590,11 @@ The general syntax is:
guix challenge @var{options} address@hidden@dots{}]
@end example
+When a difference is found between the hash of a locally-built item and
+that of a server-provided substitute, or among substitutes provided by
+different servers, the command displays it as in the example above and
+exits with a non-zero return code.
+
The one option that matters is:
@table @code
diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm
index 4a0c865..0eb49da 100644
--- a/guix/scripts/challenge.scm
+++ b/guix/scripts/challenge.scm
@@ -233,9 +233,11 @@ Challenge the substitutes for PACKAGE... provided by one
or more servers.\n"))
(run-with-store store
(mlet* %store-monad ((items (mapm %store-monad
- ensure-store-item files))
+ ensure-store-item files))
(issues (discrepancies items urls)))
(for-each summarize-discrepancy issues)
+ (unless (null? issues)
+ (exit 1))
(return (null? issues)))
#:system system)))))))
diff --git a/scripts/guix.in b/scripts/guix.in
index 8f2d8a6..5d6921d 100644
--- a/scripts/guix.in
+++ b/scripts/guix.in
@@ -64,4 +64,9 @@
(apply guix-main (command-line))))
(maybe-augment-load-paths!)
+
+ ;; XXX: It would be more convenient to change it to:
+ ;; (exit (run-guix-main))
+ ;; but since the 'guix' command is not updated by 'guix pull', we cannot
+ ;; really do it now.
(run-guix-main))