diff options
author | Mark H Weaver <mhw@netris.org> | 2015-01-11 09:38:49 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-01-11 09:38:49 -0500 |
commit | 77448857311318fc9cd866afcb85ca98fccdb25b (patch) | |
tree | efed3a71d1f7b2c2cc292e7e4ba1884c4d26a9e4 /guix/scripts/substitute-binary.scm | |
parent | 62c155c0bcbc0d71b1bc35e966193b6e8de03246 (diff) | |
parent | 0009ed71ad288358cbc7828954b5e1a3f18fd525 (diff) | |
download | guix-patches-77448857311318fc9cd866afcb85ca98fccdb25b.tar guix-patches-77448857311318fc9cd866afcb85ca98fccdb25b.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts/substitute-binary.scm')
-rwxr-xr-x | guix/scripts/substitute-binary.scm | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute-binary.scm index 9c96411630..09b917fdf6 100755 --- a/guix/scripts/substitute-binary.scm +++ b/guix/scripts/substitute-binary.scm @@ -241,7 +241,7 @@ failure." ((version _ sig) (let ((maybe-number (string->number version))) (cond ((not (number? maybe-number)) - (leave (_ "signature version must be a number: ~a~%") + (leave (_ "signature version must be a number: ~s~%") version)) ;; Currently, there are no other versions. ((not (= 1 maybe-number)) @@ -313,18 +313,15 @@ No authentication and authorization checks are performed here!" "References" "Deriver" "System" "Signature")))) -(define %signature-line-rx - ;; Regexp matching a signature line in a narinfo. - (make-regexp "(.+)^[[:blank:]]*Signature:[[:blank:]].+$")) - (define (narinfo-sha256 narinfo) "Return the sha256 hash of NARINFO as a bytevector, or #f if NARINFO lacks a 'Signature' field." (let ((contents (narinfo-contents narinfo))) - (match (regexp-exec %signature-line-rx contents) + (match (string-contains contents "Signature:") (#f #f) - ((= (cut match:substring <> 1) above-signature) - (sha256 (string->utf8 above-signature)))))) + (index + (let ((above-signature (string-take contents index))) + (sha256 (string->utf8 above-signature))))))) (define* (assert-valid-narinfo narinfo #:optional (acl (current-acl)) |