mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
channels: Add 'openpgp-fingerprint->bytevector'.
* guix/channels.scm (openpgp-fingerprint->bytevector): New procedure. (openpgp-fingerprint): New macro. (%guix-channel-introduction): Use it.
This commit is contained in:
parent
67ba9815c9
commit
6577682a6c
1 changed files with 22 additions and 5 deletions
|
@ -71,6 +71,9 @@ (define-module (guix channels)
|
||||||
channel-introduction?
|
channel-introduction?
|
||||||
;; <channel-introduction> accessors purposefully omitted for now.
|
;; <channel-introduction> accessors purposefully omitted for now.
|
||||||
|
|
||||||
|
openpgp-fingerprint->bytevector
|
||||||
|
openpgp-fingerprint
|
||||||
|
|
||||||
%default-channels
|
%default-channels
|
||||||
guix-channel?
|
guix-channel?
|
||||||
|
|
||||||
|
@ -134,6 +137,23 @@ (define-record-type <channel-introduction>
|
||||||
(first-commit-signer channel-introduction-first-commit-signer) ;bytevector
|
(first-commit-signer channel-introduction-first-commit-signer) ;bytevector
|
||||||
(signature channel-introduction-signature)) ;string
|
(signature channel-introduction-signature)) ;string
|
||||||
|
|
||||||
|
(define (openpgp-fingerprint->bytevector str)
|
||||||
|
"Convert STR, an OpenPGP fingerprint (hexadecimal string with whitespace),
|
||||||
|
to the corresponding bytevector."
|
||||||
|
(base16-string->bytevector
|
||||||
|
(string-downcase (string-filter char-set:hex-digit str))))
|
||||||
|
|
||||||
|
(define-syntax openpgp-fingerprint
|
||||||
|
(lambda (s)
|
||||||
|
"Convert STR, an OpenPGP fingerprint (hexadecimal string with whitespace),
|
||||||
|
to the corresponding bytevector."
|
||||||
|
(syntax-case s ()
|
||||||
|
((_ str)
|
||||||
|
(string? (syntax->datum #'str))
|
||||||
|
(openpgp-fingerprint->bytevector (syntax->datum #'str)))
|
||||||
|
((_ str)
|
||||||
|
#'(openpgp-fingerprint->bytevector str)))))
|
||||||
|
|
||||||
(define %guix-channel-introduction
|
(define %guix-channel-introduction
|
||||||
;; Introduction of the official 'guix channel. The chosen commit is the
|
;; Introduction of the official 'guix channel. The chosen commit is the
|
||||||
;; first one that introduces '.guix-authorizations' on the 'staging'
|
;; first one that introduces '.guix-authorizations' on the 'staging'
|
||||||
|
@ -142,11 +162,8 @@ (define %guix-channel-introduction
|
||||||
;; & co.
|
;; & co.
|
||||||
(make-channel-introduction
|
(make-channel-introduction
|
||||||
"9edb3f66fd807b096b48283debdcddccfea34bad" ;2020-05-26
|
"9edb3f66fd807b096b48283debdcddccfea34bad" ;2020-05-26
|
||||||
(base16-string->bytevector
|
(openpgp-fingerprint ;mbakke
|
||||||
(string-downcase
|
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))
|
||||||
(string-filter char-set:hex-digit ;mbakke
|
|
||||||
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))
|
|
||||||
#f)) ;TODO: Add an intro signature so it can be exported.
|
|
||||||
|
|
||||||
(define %default-channel-url
|
(define %default-channel-url
|
||||||
;; URL of the default 'guix' channel.
|
;; URL of the default 'guix' channel.
|
||||||
|
|
Loading…
Reference in a new issue