aboutsummaryrefslogtreecommitdiff
path: root/guix/gnu-maintenance.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@igalia.com>2016-02-18 20:50:02 +0100
committerMark H Weaver <mhw@netris.org>2016-02-24 11:49:57 -0500
commit62061d6be3614dd84a1d0034dd5946f7e54fbaea (patch)
tree0267dcd61fd0cba59c016ba90c32eb19d09ac635 /guix/gnu-maintenance.scm
parent0e47b4e7690c1c8dd2d4ec9056215c99653fe40b (diff)
downloadgnu-guix-62061d6be3614dd84a1d0034dd5946f7e54fbaea.tar
gnu-guix-62061d6be3614dd84a1d0034dd5946f7e54fbaea.tar.gz
gnu-maintenance: Add X.org updater.
* guix/gnu-maintenance.scm (xorg-package?, latest-xorg-release): New private functions. (%xorg-updater): New public variable. * guix/scripts/refresh.scm (%updaters): Add %xorg-updater. * doc/guix.texi (Invoking guix refresh): Mention the new updater.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r--guix/gnu-maintenance.scm37
1 files changed, 36 insertions, 1 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 96fbfb76b4..9d720ca030 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -33,6 +33,7 @@
#:use-module (guix records)
#:use-module (guix upstream)
#:use-module (guix packages)
+ #:use-module (gnu packages)
#:export (gnu-package-name
gnu-package-mundane-name
gnu-package-copyright-holder
@@ -57,7 +58,8 @@
gnu-package-name->name+version
%gnu-updater
- %gnome-updater))
+ %gnome-updater
+ %xorg-updater))
;;; Commentary:
;;;
@@ -508,6 +510,32 @@ elpa.gnu.org, and all the GNOME packages."
;; checksums.
#:file->signature (const #f))))
+(define (xorg-package? package)
+ "Return true if PACKAGE is an X.org package, developed by X.org."
+ (define xorg-uri?
+ (match-lambda
+ ((? string? uri)
+ (string-prefix? "mirror://xorg/" uri))
+ (_
+ #f)))
+
+ (match (package-source package)
+ ((? origin? origin)
+ (match (origin-uri origin)
+ ((? xorg-uri?) #t)
+ (_ #f)))
+ (_ #f)))
+
+(define (latest-xorg-release package)
+ "Return the latest release of PACKAGE, the name of an X.org package."
+ (let ((uri (string->uri (origin-uri (package-source (specification->package package))))))
+ (false-if-ftp-error
+ (latest-ftp-release
+ package
+ #:server "ftp.freedesktop.org"
+ #:directory
+ (string-append "/pub/xorg/" (dirname (uri-path uri)))))))
+
(define %gnu-updater
(upstream-updater
(name 'gnu)
@@ -522,4 +550,11 @@ elpa.gnu.org, and all the GNOME packages."
(pred gnome-package?)
(latest latest-gnome-release)))
+(define %xorg-updater
+ (upstream-updater
+ (name 'xorg)
+ (description "Updater for X.org packages")
+ (pred xorg-package?)
+ (latest latest-xorg-release)))
+
;;; gnu-maintenance.scm ends here