Subject: [PATCH 04/20] import: sourceforge: Issue error-message if version is given.

From: Hartmut Goebel <[email-masked]>
Date: Sun, 28 Aug 2022 15:18:30 +0200

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(-)

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"))
-- 
2.30.4