summaryrefslogtreecommitdiff
path: root/guix/gnu-maintenance.scm
diff options
context:
space:
mode:
authorNikita Karetnikov <nikita@karetnikov.org>2013-06-10 07:46:13 +0000
committerNikita Karetnikov <nikita@karetnikov.org>2013-06-10 08:15:17 +0000
commit392b5d8cab0c676f19d14a139f14802ef0237ddf (patch)
treecb8ef6410db89e6282c94aab63b3313c777c64f8 /guix/gnu-maintenance.scm
parente20ec9cc5165f1312bd1a057bf4da48bb5102385 (diff)
downloadguix-patches-392b5d8cab0c676f19d14a139f14802ef0237ddf.tar
guix-patches-392b5d8cab0c676f19d14a139f14802ef0237ddf.tar.gz
guix refresh: Add '--key-download'.
* guix/gnu-maintenance.scm (download-tarball): Add a 'key-download' keyword argument and pass it to 'gnupg-verify*'. Make 'archive-type' a keyword argument. (package-update): Add a 'key-download' keyword argument. Pass 'archive-type' and 'key-download' keyword arguments to 'download-tarball'. * guix/gnupg.scm: Import (ice-9 i18n) and (guix ui). (gnupg-verify*): Add a 'key-download' keyword argument and adjust 'gnupg-verify*' to use it. Make 'server' a keyword argument. * guix/scripts/refresh.scm (show-help, %options): Add and document '--key-download'. (update-package): Add a 'key-download' keyword argument and pass it to 'package-update'. (guix-refresh): Pass 'key-download' to 'update-package'. Limit lines to a maximum of 79 characters.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r--guix/gnu-maintenance.scm18
1 files changed, 12 insertions, 6 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index b54cd84ecf..b460976f4e 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -341,16 +341,19 @@ pairs. Example: (\"mit-scheme-9.0.1\" . \"/gnu/mit-scheme/stable.pkg/9.0.1\").
(_ #f))))
(define* (download-tarball store project directory version
- #:optional (archive-type "gz"))
+ #:key (archive-type "gz")
+ (key-download 'interactive))
"Download PROJECT's tarball over FTP and check its OpenPGP signature. On
-success, return the tarball file name."
+success, return the tarball file name. KEY-DOWNLOAD specifies a download
+policy for missing OpenPGP keys; allowed values: 'interactive' (default),
+'always', and 'never'."
(let* ((server (ftp-server/directory project))
(base (string-append project "-" version ".tar." archive-type))
(url (string-append "ftp://" server "/" directory "/" base))
(sig-url (string-append url ".sig"))
(tarball (download-to-store store url))
(sig (download-to-store store sig-url)))
- (let ((ret (gnupg-verify* sig tarball)))
+ (let ((ret (gnupg-verify* sig tarball #:key-download key-download)))
(if ret
tarball
(begin
@@ -359,9 +362,11 @@ success, return the tarball file name."
(warning (_ "(could be because the public key is not in your keyring)~%"))
#f)))))
-(define (package-update store package)
+(define* (package-update store package #:key (key-download 'interactive))
"Return the new version and the file name of the new version tarball for
-PACKAGE, or #f and #f when PACKAGE is up-to-date."
+PACKAGE, or #f and #f when PACKAGE is up-to-date. KEY-DOWNLOAD specifies a
+download policy for missing OpenPGP keys; allowed values: 'always', 'never',
+and 'interactive' (default)."
(match (package-update-path package)
((version . directory)
(let-values (((name)
@@ -372,7 +377,8 @@ PACKAGE, or #f and #f when PACKAGE is up-to-date."
(file-extension (origin-uri source)))
"gz"))))
(let ((tarball (download-tarball store name directory version
- archive-type)))
+ #:archive-type archive-type
+ #:key-download key-download)))
(values version tarball))))
(_
(values #f #f))))