challenge: Fix type mismatch when comparing to a local hash.
authorLudovic Courtès <ludo@gnu.org>
Sat, 14 Dec 2019 13:59:32 +0000 (14:59 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sat, 14 Dec 2019 23:34:05 +0000 (00:34 +0100)
* guix/scripts/challenge.scm (call-with-mismatches)[narinfo1]: When
LOCAL-HASH is true, call 'narinfo-hash->sha256' and use 'bytevector=?'
instead of 'string=?'.

guix/scripts/challenge.scm

index 51e8d3e..ebeebd5 100644 (file)
@@ -321,8 +321,9 @@ specified in COMPARISON-REPORT."
         (define narinfo1
           (if local-hash
               (find (lambda (narinfo)
-                      (not (string=? (narinfo-hash narinfo)
-                                     local-hash)))
+                      (not (bytevector=? (narinfo-hash->sha256
+                                          (narinfo-hash narinfo))
+                                         local-hash)))
                     narinfos)
               (first (comparison-report-narinfos comparison-report))))