[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
19/23: kde:
From: |
guix-commits |
Subject: |
19/23: kde: |
Date: |
Mon, 4 Jul 2022 09:49:27 -0400 (EDT) |
htgoebel pushed a commit to branch wip-import-version
in repository guix.
commit 0c338d426261fd21fa40821f4c49ce8c9d0c54be
Author: Hartmut Goebel <h.goebel@crazy-compilers.com>
AuthorDate: Wed Jun 29 12:29:08 2022 +0200
kde:
* guix/import/kde.scm(latest-kde-release): kw-arg version, this argument
overrules the version from projekt-info. Rework the code to not sort the
relevant files, but just find the latest version.
[find-latest-archive-version]: New function.
---
guix/import/kde.scm | 56 +++++++++++++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 23 deletions(-)
diff --git a/guix/import/kde.scm b/guix/import/kde.scm
index 6873418d62..8b501ec03d 100644
--- a/guix/import/kde.scm
+++ b/guix/import/kde.scm
@@ -28,6 +28,7 @@
#:use-module (ice-9 match)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 regex)
+ #:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
#:use-module (web uri)
@@ -149,38 +150,47 @@ Output:
(string-join (map version->pattern directory-parts) "/")
"/"))))
-(define (latest-kde-release package)
+(define* (latest-kde-release package #:key (version #f))
"Return the latest release of PACKAGE, a KDE package, or #f if it could
not be determined."
+
+ (define (find-latest-archive-version archives)
+ (fold (lambda (file1 file2)
+ (if (and file2
+ (version>? (tarball-sans-extension (basename file2))
+ (tarball-sans-extension (basename file1))))
+ file2
+ file1))
+ #f
+ archives))
+
(let* ((uri (string->uri (origin-uri (package-source package))))
(path-rx (uri->kde-path-pattern uri))
(name (package-upstream-name package))
(files (download.kde.org-files))
+ ;; select archives for this package
(relevant (filter (lambda (file)
(and (regexp-exec path-rx file)
(release-file? name (basename file))))
- files)))
- (match (sort relevant (lambda (file1 file2)
- (version>? (tarball-sans-extension
- (basename file1))
- (tarball-sans-extension
- (basename file2)))))
- ((and tarballs (reference _ ...))
- (let* ((version (tarball->version reference))
- (tarballs (filter (lambda (file)
- (string=? (tarball-sans-extension
- (basename file))
- (tarball-sans-extension
- (basename reference))))
- tarballs)))
- (upstream-source
- (package name)
- (version version)
- (urls (map (lambda (file)
- (string-append "mirror://kde/" file))
- tarballs)))))
- (()
- #f))))
+ files))
+ ;; find latest version
+ (version (or version
+ (and (not (null? relevant))
+ (tarball->version (find-latest-archive-version
relevant)))))
+ ;; find archives matching this version
+ (archives (filter (lambda (file)
+ (string=? version (tarball->version file)))
+ relevant)))
+ (match archives
+ (() #f)
+ (_
+ (upstream-source
+ (package name)
+ (version version)
+ (urls (map (lambda (file)
+ (string-append "mirror://kde/" file))
+ archives)))))))
+
(define %kde-updater
(upstream-updater
- 06/23: import: github: Fix updater., (continued)
- 06/23: import: github: Fix updater., guix-commits, 2022/07/04
- 07/23: import: git: Restrict to non-github origins., guix-commits, 2022/07/04
- 09/23: updaters: issue error-message if version is given:, guix-commits, 2022/07/04
- 11/23: sourceforge: not supported, too complicate to implement., guix-commits, 2022/07/04
- 10/23: cran/bioconductor, guix-commits, 2022/07/04
- 12/23: gnu-maintenance (kernel.org, ftp, html, savannah, xorg, gnu), guix-commits, 2022/07/04
- 13/23: pypi:, guix-commits, 2022/07/04
- 15/23: egg, guix-commits, 2022/07/04
- 16/23: hexpm, guix-commits, 2022/07/04
- 14/23: crate, guix-commits, 2022/07/04
- 19/23: kde:,
guix-commits <=
- 21/23: generic-git, guix-commits, 2022/07/04
- 23/23: upstream.scm, guix-commits, 2022/07/04
- 17/23: launchpad, guix-commits, 2022/07/04
- 18/23: gnome:, guix-commits, 2022/07/04
- 20/23: github REWORD, guix-commits, 2022/07/04
- 22/23: refresh, guix-commits, 2022/07/04