Subject: [bug#67897] [PATCH] guix: import: composer: Fix latest-release function.

From: Nicolas Graves <[email-masked]>
Date: Tue, 19 Dec 2023 11:38:02 +0100

* guix/import/composer.scm (latest-release): Support additional
version argument. Replace package-name by composer-package-name.

Change-Id: Ia55a841c8fe23e2d9c35ce80ab695c325ad8f962
---
 guix/import/composer.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 1ad608964b..069a950f90 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -243,14 +243,14 @@ (define (php-package? package)
    (eq? (package-build-system package) composer-build-system)
    (string-prefix? "php-" (package-name package))))
 
-(define (latest-release package)
+(define* (latest-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((php-name (guix-package->composer-name package))
-         (package (composer-fetch php-name))
+         (package (composer-fetch php-name #:version version))
          (version (composer-package-version package))
          (url (composer-source-url (composer-package-source package))))
     (upstream-source
-     (package (package-name package))
+     (package (composer-package-name package))
      (version version)
      (urls (list url)))))
 
-- 
2.41.0