GNU bug report logs - #42192
[PATCH 0/3] Improve launchpad updater

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Sat, 4 Jul 2020 18:27:01 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42192 in the body.
You can then email your comments to 42192 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#42192; Package guix-patches. (Sat, 04 Jul 2020 18:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arun Isaac <arunisaac <at> systemreboot.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 04 Jul 2020 18:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: guix-patches <at> gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 0/3] Improve launchpad updater
Date: Sat,  4 Jul 2020 23:55:48 +0530
This patchset fixes a bug in the launchpad importer, and improves it to
recognize more URLs and extensions. `guix refresh --list-updaters` reports an
improvement in coverage from 0.1% to 0.2%.

On a side note, all our updaters try to detect the URL format through a series
of guesses. But, all our packages already encode information about how to
construct the source URL from the version. If we could somehow tap into that
information, our updaters would be much simpler. Unfortunately, all the uri
fields of packages are strings. We would need them to be functions that take
the version as an argument. This is a major conversion. Is it feasible? Any
better ideas?

Arun Isaac (3):
  import: launchpad: Handle list of source URLs correctly.
  import: launchpad: Recognize the .orig.tar.gz extension.
  import: launchpad: Recognize more URLs.

 guix/import/launchpad.scm | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#42192; Package guix-patches. (Sat, 04 Jul 2020 18:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 42192 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 42192 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 1/3] import: launchpad: Handle list of source URLs correctly.
Date: Sun,  5 Jul 2020 00:03:30 +0530
* guix/import/launchpad.scm (updated-launchpad-url): Return updated URL when
package has a list of URLs, not the old URL.
---
 guix/import/launchpad.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index c7375837c7..1162cbe123 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Arun Isaac <arunisaac <at> systemreboot.net>
+;;; Copyright © 2019, 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,7 +66,7 @@ false if none is recognized"
               ((? string?)
                (updated-url source-uri))
               ((source-uri ...)
-               (find updated-url source-uri))))))
+               (any updated-url source-uri))))))
     (_ #f)))
 
 (define (launchpad-package? package)
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#42192; Package guix-patches. (Sat, 04 Jul 2020 18:34:02 GMT) Full text and rfc822 format available.

Message #11 received at 42192 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 42192 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 3/3] import: launchpad: Recognize more URLs.
Date: Sun,  5 Jul 2020 00:03:32 +0530
* guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs.
---
 guix/import/launchpad.scm | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index c991ccfe6e..fd3cfa8444 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -46,15 +46,35 @@ false if none is recognized"
                (version (package-version old-package))
                (repo (launchpad-repository url)))
            (cond
-            ((and
-              (>= (length (string-split version #\.)) 2)
-              (string=? (string-append "https://launchpad.net/"
-                                       repo "/" (version-major+minor version)
-                                       "/" version "/+download/" repo "-" version ext)
-                        url))
+            ((< (length (string-split version #\.)) 2) #f)
+            ((string=? (string-append "https://launchpad.net/"
+                                      repo "/" (version-major+minor version)
+                                      "/" version "/+download/" repo "-" version ext)
+                       url)
              (string-append "https://launchpad.net/"
                             repo "/" (version-major+minor new-version)
                             "/" new-version "/+download/" repo "-" new-version ext))
+            ((string=? (string-append "https://launchpad.net/"
+                                      repo "/" (version-major+minor version)
+                                      "/" version "/+download/" repo "_" version ext)
+                       url)
+             (string-append "https://launchpad.net/"
+                            repo "/" (version-major+minor new-version)
+                            "/" new-version "/+download/" repo "-" new-version ext))
+            ((string=? (string-append "https://launchpad.net/"
+                                      repo "/trunk/" version "/+download/"
+                                      repo "-" version ext)
+                       url)
+             (string-append "https://launchpad.net/"
+                            repo "/trunk/" new-version
+                            "/+download/" repo "-" new-version ext))
+            ((string=? (string-append "https://launchpad.net/"
+                                      repo "/trunk/" version "/+download/"
+                                      repo "_" version ext)
+                       url)
+             (string-append "https://launchpad.net/"
+                            repo "/trunk/" new-version
+                            "/+download/" repo "_" new-version ext))
             (#t #f))))) ; Some URLs are not recognised.
 
   (match (package-source old-package)
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#42192; Package guix-patches. (Sat, 04 Jul 2020 18:34:02 GMT) Full text and rfc822 format available.

Message #14 received at 42192 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 42192 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 2/3] import: launchpad: Recognize the .orig.tar.gz extension.
Date: Sun,  5 Jul 2020 00:03:31 +0530
* guix/import/launchpad.scm (find-extension): Recognize the .orig.tar.gz
extension.
---
 guix/import/launchpad.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index 1162cbe123..c991ccfe6e 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -32,7 +32,7 @@
   "Return the extension of the archive e.g. '.tar.gz' given a URL, or
 false if none is recognized"
   (find (lambda (x) (string-suffix? x url))
-        (list ".tar.gz" ".tar.bz2" ".tar.xz"
+        (list ".orig.tar.gz" ".tar.gz" ".tar.bz2" ".tar.xz"
               ".zip" ".tar" ".tgz" ".tbz" ".love")))
 
 (define (updated-launchpad-url old-package new-version)
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#42192; Package guix-patches. (Mon, 31 Aug 2020 13:30:02 GMT) Full text and rfc822 format available.

Message #17 received at 42192 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 42192 <at> debbugs.gnu.org
Subject: Re: [bug#42192] [PATCH 0/3] Improve launchpad updater
Date: Mon, 31 Aug 2020 15:29:34 +0200
Hi Arun,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

> This patchset fixes a bug in the launchpad importer, and improves it to
> recognize more URLs and extensions. `guix refresh --list-updaters` reports an
> improvement in coverage from 0.1% to 0.2%.

All three patches LGTM, thank you!

> On a side note, all our updaters try to detect the URL format through a series
> of guesses. But, all our packages already encode information about how to
> construct the source URL from the version. If we could somehow tap into that
> information, our updaters would be much simpler. Unfortunately, all the uri
> fields of packages are strings. We would need them to be functions that take
> the version as an argument. This is a major conversion. Is it feasible? Any
> better ideas?

I sympathize with the idea, but I think it’s a bit too ambitious.  All
in all, what we currently have seems like a reasonable tradeoff.

Ludo’.




Reply sent to Arun Isaac <arunisaac <at> systemreboot.net>:
You have taken responsibility. (Tue, 01 Sep 2020 17:21:01 GMT) Full text and rfc822 format available.

Notification sent to Arun Isaac <arunisaac <at> systemreboot.net>:
bug acknowledged by developer. (Tue, 01 Sep 2020 17:21:01 GMT) Full text and rfc822 format available.

Message #22 received at 42192-done <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 42192-done <at> debbugs.gnu.org
Subject: Re: [bug#42192] [PATCH 0/3] Improve launchpad updater
Date: Tue, 01 Sep 2020 22:50:46 +0530
>> This patchset fixes a bug in the launchpad importer, and improves it to
>> recognize more URLs and extensions. `guix refresh --list-updaters` reports an
>> improvement in coverage from 0.1% to 0.2%.
>
> All three patches LGTM, thank you!

Pushed to master, thanks for the review!

> I sympathize with the idea, but I think it’s a bit too ambitious.  All
> in all, what we currently have seems like a reasonable tradeoff.

Fair enough. :-)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Sep 2020 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.