aboutsummaryrefslogtreecommitdiff
path: root/guix/gnu-maintenance.scm
diff options
context:
space:
mode:
authorDavid Craven <david@craven.ch>2016-08-01 11:05:28 +0200
committerDavid Craven <david@craven.ch>2016-08-02 13:28:21 +0200
commit9c97afe8588d4e822676d278e251247d1476df7c (patch)
tree8d5ef3238995b3a18c995a112046d9f0f524c2a4 /guix/gnu-maintenance.scm
parentff02b826780ee5f85f5a363114b5234b6d44dfd1 (diff)
downloadgnu-guix-9c97afe8588d4e822676d278e251247d1476df7c.tar
gnu-guix-9c97afe8588d4e822676d278e251247d1476df7c.tar.gz
gnu-maintenance: Add KDE updater.
* guix/gnu-maintenance.scm (kde-package?, latest-kde-release): New private functions. (%kde-updater): New public variable. * guix/scripts/refresh.scm (list-updaters): Add %kde-updater. * doc/guix.texi (Invoking guix refresh): Mention the new updater.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r--guix/gnu-maintenance.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 0dd08bf535..20f08027da 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -59,6 +59,7 @@
%gnu-updater
%gnome-updater
+ %kde-updater
%xorg-updater))
;;; Commentary:
@@ -500,6 +501,33 @@ elpa.gnu.org, and all the GNOME packages."
;; checksums.
#:file->signature (const #f))))
+(define (kde-package? package)
+ "Return true if PACKAGE is a KDE package, developed by KDE.org."
+ (define kde-uri?
+ (match-lambda
+ ((? string? uri)
+ (string-prefix? "mirror://kde/" uri))
+ (_
+ #f)))
+
+ (match (package-source package)
+ ((? origin? origin)
+ (match (origin-uri origin)
+ ((? kde-uri?) #t)
+ (_ #f)))
+ (_ #f)))
+
+(define (latest-kde-release package)
+ "Return the latest release of PACKAGE, the name of an KDE.org package."
+ (let ((uri (string->uri (origin-uri (package-source package)))))
+ (false-if-ftp-error
+ (latest-ftp-release
+ (package-name package)
+ #:server "mirrors.mit.edu"
+ #:directory
+ (string-append "/kde" (dirname (dirname (uri-path uri))))
+ #:file->signature (const #f)))))
+
(define (xorg-package? package)
"Return true if PACKAGE is an X.org package, developed by X.org."
(define xorg-uri?
@@ -540,6 +568,13 @@ elpa.gnu.org, and all the GNOME packages."
(pred gnome-package?)
(latest latest-gnome-release)))
+(define %kde-updater
+ (upstream-updater
+ (name 'kde)
+ (description "Updater for KDE packages")
+ (pred kde-package?)
+ (latest latest-kde-release)))
+
(define %xorg-updater
(upstream-updater
(name 'xorg)