aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-11-30 16:29:15 +0100
committerLudovic Courtès <ludo@gnu.org>2016-11-30 17:35:21 +0100
commit2fd370e8167be9a0af9e5358757d58d1acaf02e0 (patch)
treeecd5db1022a4113fa74414249ecc7c817f75dda4
parent8d5d06282e255557d3bdda1794bd3fea2c84ff59 (diff)
downloadpatches-2fd370e8167be9a0af9e5358757d58d1acaf02e0.tar
patches-2fd370e8167be9a0af9e5358757d58d1acaf02e0.tar.gz
gnu-maintenance: Add kernel.org updater.
* guix/gnu-maintenance.scm (latest-kernel.org-release): New procedure. (%kernel.org-updater): New variable. * guix/scripts/refresh.scm (%updaters): Add it.
-rw-r--r--doc/guix.texi2
-rw-r--r--guix/gnu-maintenance.scm26
-rw-r--r--guix/scripts/refresh.scm4
3 files changed, 30 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 53d29e45be..37bdb69b56 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5342,6 +5342,8 @@ the updater for GNOME packages;
the updater for KDE packages;
@item xorg
the updater for X.org packages;
+@item kernel.org
+the updater for packages hosted on kernel.org;
@item elpa
the updater for @uref{http://elpa.gnu.org/, ELPA} packages;
@item cran
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 90ca7a45e3..4d4bb452be 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -60,7 +60,8 @@
%gnu-updater
%gnome-updater
%kde-updater
- %xorg-updater))
+ %xorg-updater
+ %kernel.org-updater))
;;; Commentary:
;;;
@@ -532,6 +533,22 @@ source URLs starts with PREFIX."
#:directory
(string-append "/pub/xorg/" (dirname (uri-path uri)))))))
+(define (latest-kernel.org-release package)
+ "Return the latest release of PACKAGE, the name of a kernel.org package."
+ (let ((uri (string->uri (origin-uri (package-source package)))))
+ (false-if-ftp-error
+ (latest-ftp-release
+ (package-name package)
+ #:server "ftp.free.fr" ;a mirror reachable over FTP
+ #:directory (string-append "/mirrors/ftp.kernel.org"
+ (dirname (uri-path uri)))
+
+ ;; kernel.org provides "foo-x.y.tar.sign" files, which are signatures of
+ ;; the uncompressed tarball.
+ #:file->signature (lambda (tarball)
+ (string-append (file-sans-extension tarball)
+ ".sign"))))))
+
(define %gnu-updater
(upstream-updater
(name 'gnu)
@@ -560,4 +577,11 @@ source URLs starts with PREFIX."
(pred (url-prefix-predicate "mirror://xorg/"))
(latest latest-xorg-release)))
+(define %kernel.org-updater
+ (upstream-updater
+ (name 'kernel.org)
+ (description "Updater for packages hosted on kernel.org")
+ (pred (url-prefix-predicate "mirror://kernel.org/"))
+ (latest latest-kernel.org-release)))
+
;;; gnu-maintenance.scm ends here
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 91a31a280b..12a344e1a0 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -35,7 +35,8 @@
#:select (%gnu-updater
%gnome-updater
%kde-updater
- %xorg-updater))
+ %xorg-updater
+ %kernel.org-updater))
#:use-module (guix import elpa)
#:use-module (guix import cran)
#:use-module (guix import hackage)
@@ -200,6 +201,7 @@ unavailable optional dependencies such as Guile-JSON."
%gnome-updater
%kde-updater
%xorg-updater
+ %kernel.org-updater
%elpa-updater
%cran-updater
%bioconductor-updater