From 6efa6f7645a95a08b0d4c663cd4a873eb0003555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 7 Dec 2015 23:54:35 +0100 Subject: [PATCH] gnu-maintenance: ftp.gnome.org does not provide signatures. * guix/gnu-maintenance.scm (latest-ftp-release): Add #:file->signature parameter. Honor it. (latest-gnome-release): Pass #:file->signature. * guix/upstream.scm (coalesce-sources): Keep 'signature-urls' as #f unless both sources provide it. --- guix/gnu-maintenance.scm | 15 ++++++++++++--- guix/upstream.scm | 5 +++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 5ca2923379..93645367e9 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -321,10 +321,13 @@ (define* (latest-ftp-release project #:key (server "ftp.gnu.org") (directory (string-append "/gnu/" project)) + (file->signature (cut string-append <> ".sig")) (ftp-open ftp-open) (ftp-close ftp-close)) "Return an for the latest release of PROJECT on SERVER under DIRECTORY, or #f. Use FTP-OPEN and FTP-CLOSE to open (resp. close) FTP -connections; this can be useful to reuse connections." +connections; this can be useful to reuse connections. FILE->SIGNATURE must be +a procedure; it is passed a source file URL and must return the corresponding +signature URL, or #f it signatures are unavailable." (define (latest a b) (if (version>? a b) a b)) @@ -350,7 +353,9 @@ (define (file->source directory file) (package project) (version (tarball->version file)) (urls (list url)) - (signature-urls (list (string-append url ".sig")))))) + (signature-urls (match (file->signature url) + (#f #f) + (sig (list sig))))))) (let loop ((directory directory) (result #f)) @@ -468,7 +473,11 @@ (define (latest-gnome-release package) #:directory (string-append "/pub/gnome/sources/" (match package ("gconf" "GConf") - (x x)))))) + (x x))) + + ;; ftp.gnome.org provides no signatures, only + ;; checksums. + #:file->signature (const #f)))) (define %gnu-updater (upstream-updater diff --git a/guix/upstream.scm b/guix/upstream.scm index 12eed3f2b4..c62667dd01 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -98,8 +98,9 @@ (define (release>? r1 r2) (urls (append (upstream-source-urls release) (upstream-source-urls head))) (signature-urls - (append (upstream-source-signature-urls release) - (upstream-source-signature-urls head)))) + (let ((one (upstream-source-signature-urls release)) + (two (upstream-source-signature-urls release))) + (and one two (append one two))))) tail) (cons release result))) (()