From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: [PATCH 03/31] gnu-maintenance: Add KDE updater. Date: Mon, 1 Aug 2016 20:13:14 +0200 Message-ID: <20160801181342.16203-4-david@craven.ch> References: <20160801181342.16203-1-david@craven.ch> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUHj6-0008UY-J5 for guix-devel@gnu.org; Mon, 01 Aug 2016 14:14:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUHj4-0000qv-97 for guix-devel@gnu.org; Mon, 01 Aug 2016 14:14:07 -0400 Received: from so254-10.mailgun.net ([198.61.254.10]:35209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUHj3-0000oW-1r for guix-devel@gnu.org; Mon, 01 Aug 2016 14:14:06 -0400 In-Reply-To: <20160801181342.16203-1-david@craven.ch> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: David Craven * 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. --- doc/guix.texi | 2 ++ guix/gnu-maintenance.scm | 35 +++++++++++++++++++++++++++++++++++ guix/scripts/refresh.scm | 6 +++++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 786fe55..d029b3f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4985,6 +4985,8 @@ list of updaters). Currently, @var{updater} may be one of: the updater for GNU packages; @item gnome the updater for GNOME packages; +@item kde +the updater for KDE packages; @item xorg the updater for X.org packages; @item elpa diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 0dd08bf..20f0802 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) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 209f0d8..b00ac98 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -32,7 +32,10 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module ((guix gnu-maintenance) - #:select (%gnu-updater %gnome-updater %xorg-updater)) + #:select (%gnu-updater + %gnome-updater + %kde-updater + %xorg-updater)) #:use-module (guix import elpa) #:use-module (guix import cran) #:use-module (guix import hackage) @@ -195,6 +198,7 @@ unavailable optional dependencies such as Guile-JSON." ;; List of "updaters" used by default. They are consulted in this order. (list-updaters %gnu-updater %gnome-updater + %kde-updater %xorg-updater %elpa-updater %cran-updater -- 2.9.0