diff mbox series

[bug#57460,04/20] import: sourceforge: Issue error-message if version is given.

Message ID 1a9944cefa8d235753b3d099e88b68c854813e8b.1661691694.git.h.goebel@crazy-compilers.com
State New
Headers show
Series Refresh to specific version | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Hartmut Goebel Aug. 28, 2022, 1:18 p.m. UTC
Due to the complicated directory structure at sourceforce,
enabling the  sourceforge importer to update to a specific version
is very complicated to implement. Since only 2.0% of the
packages in guix are covered by this updater I dedided to now
implement this.

* guix/gnu-maintenance.scm(latest-sourceforge-release): Issue
  error-message if version is given.
---
 guix/gnu-maintenance.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

M Aug. 28, 2022, 1:22 p.m. UTC | #1
On 28-08-2022 15:18, Hartmut Goebel wrote:
> Due to the complicated directory structure at sourceforce,
> enabling the  sourceforge importer to update to a specific version
> is very complicated to implement. Since only 2.0% of the
> packages in guix are covered by this updater I dedided to now
> implement this.
Nitpick: now -> not?
diff mbox series

Patch

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index a278903a8d..8446a59fb5 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -34,6 +34,8 @@ 
   #:use-module ((guix http-client) #:hide (open-socket-for-uri))
   #:use-module (guix ftp-client)
   #:use-module (guix utils)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
   #:use-module (guix memoization)
   #:use-module (guix records)
   #:use-module (guix upstream)
@@ -683,7 +685,7 @@  GNOME packages; EMMS is included though, because its releases are on gnu.org."
                                 #:directory directory)
            (cut adjusted-upstream-source <> rewrite))))
 
-(define (latest-sourceforge-release package)
+(define* (latest-sourceforge-release package #:key (version #f))
   "Return the latest release of PACKAGE."
   (define (uri-append uri extension)
     ;; Return URI with EXTENSION appended.
@@ -698,6 +700,12 @@  GNOME packages; EMMS is included though, because its releases are on gnu.org."
        ((200 302) #t)
        (else #f))))
 
+  (when version
+    (error
+     (formatted-message
+      (G_ "Updating to a specific version is not yet implemented for ~a, sorry.")
+      "sourceforge")))
+
   (let* ((name     (package-upstream-name package))
          (base     (string-append "https://sourceforge.net/projects/"
                                   name "/files"))