all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#49112] [PATCH] import: launchpad: Use repository to retrieve releases.
@ 2021-06-19 10:07 Matthew James Kraai
  2021-06-19 20:38 ` Brice Waegeneire
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew James Kraai @ 2021-06-19 10:07 UTC (permalink / raw)
  To: 49112; +Cc: Matthew James Kraai

* guix/import/launchpad.scm (latest-released-version): Use repository instead
of package name.
(latest-release): Pass repository to latest-released-version.
---
 guix/import/launchpad.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index a52b39a085..23ac6a3c7b 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -100,8 +100,8 @@ URL of the form
   (match (string-split (uri-path (string->uri url)) #\/)
     ((_ repo . rest) repo)))
 
-(define (latest-released-version package-name)
-  "Return a string of the newest released version name given the PACKAGE-NAME,
+(define (latest-released-version repository)
+  "Return a string of the newest released version name given the REPOSITORY,
 for example, 'linuxdcpp'. Return #f if there is no releases."
   (define (pre-release? x)
     ;; Versions containing anything other than digit characters and "." (for
@@ -112,7 +112,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
 
   (match (json-fetch
           (string-append "https://api.launchpad.net/1.0/"
-                         package-name "/releases"))
+                         repository "/releases"))
     (#f #f)                                       ;404 or similar
     (json
      (assoc-ref
@@ -129,7 +129,8 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
 
   (let* ((source-uri (origin-github-uri (package-source pkg)))
          (name (package-name pkg))
-         (newest-version (latest-released-version name)))
+         (repository (launchpad-repository source-uri))
+         (newest-version (latest-released-version repository)))
     (if newest-version
         (upstream-source
          (package name)
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#49112] [PATCH] import: launchpad: Use repository to retrieve releases.
  2021-06-19 10:07 [bug#49112] [PATCH] import: launchpad: Use repository to retrieve releases Matthew James Kraai
@ 2021-06-19 20:38 ` Brice Waegeneire
  0 siblings, 0 replies; 2+ messages in thread
From: Brice Waegeneire @ 2021-06-19 20:38 UTC (permalink / raw)
  To: Matthew James Kraai; +Cc: 49112

Hello Matthew,

Thank you for the patch!

Matthew James Kraai <kraai@ftbfs.org> writes:

> * guix/import/launchpad.scm (latest-released-version): Use repository instead
> of package name.
> (latest-release): Pass repository to latest-released-version.

I had a patch for this, but yours is cleaner, using
'launchpad-directory'.  I have added a copyright line and pushed as 9171079e515289120405c70c143445df2a35db1c.

Cheers,
- Brice




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-19 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-19 10:07 [bug#49112] [PATCH] import: launchpad: Use repository to retrieve releases Matthew James Kraai
2021-06-19 20:38 ` Brice Waegeneire

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.