unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#42192] [PATCH 0/3] Improve launchpad updater
@ 2020-07-04 18:25 Arun Isaac
  2020-07-04 18:33 ` [bug#42192] [PATCH 1/3] import: launchpad: Handle list of source URLs correctly Arun Isaac
  2020-08-31 13:29 ` [bug#42192] [PATCH 0/3] Improve launchpad updater Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Arun Isaac @ 2020-07-04 18:25 UTC (permalink / raw)
  To: 42192; +Cc: Arun Isaac

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





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

* [bug#42192] [PATCH 1/3] import: launchpad: Handle list of source URLs correctly.
  2020-07-04 18:25 [bug#42192] [PATCH 0/3] Improve launchpad updater Arun Isaac
@ 2020-07-04 18:33 ` Arun Isaac
  2020-07-04 18:33   ` [bug#42192] [PATCH 2/3] import: launchpad: Recognize the .orig.tar.gz extension Arun Isaac
  2020-07-04 18:33   ` [bug#42192] [PATCH 3/3] import: launchpad: Recognize more URLs Arun Isaac
  2020-08-31 13:29 ` [bug#42192] [PATCH 0/3] Improve launchpad updater Ludovic Courtès
  1 sibling, 2 replies; 6+ messages in thread
From: Arun Isaac @ 2020-07-04 18:33 UTC (permalink / raw)
  To: 42192; +Cc: Arun Isaac

* 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@systemreboot.net>
+;;; Copyright © 2019, 2020 Arun Isaac <arunisaac@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





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

* [bug#42192] [PATCH 2/3] import: launchpad: Recognize the .orig.tar.gz extension.
  2020-07-04 18:33 ` [bug#42192] [PATCH 1/3] import: launchpad: Handle list of source URLs correctly Arun Isaac
@ 2020-07-04 18:33   ` Arun Isaac
  2020-07-04 18:33   ` [bug#42192] [PATCH 3/3] import: launchpad: Recognize more URLs Arun Isaac
  1 sibling, 0 replies; 6+ messages in thread
From: Arun Isaac @ 2020-07-04 18:33 UTC (permalink / raw)
  To: 42192; +Cc: Arun Isaac

* 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





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

* [bug#42192] [PATCH 3/3] import: launchpad: Recognize more URLs.
  2020-07-04 18:33 ` [bug#42192] [PATCH 1/3] import: launchpad: Handle list of source URLs correctly Arun Isaac
  2020-07-04 18:33   ` [bug#42192] [PATCH 2/3] import: launchpad: Recognize the .orig.tar.gz extension Arun Isaac
@ 2020-07-04 18:33   ` Arun Isaac
  1 sibling, 0 replies; 6+ messages in thread
From: Arun Isaac @ 2020-07-04 18:33 UTC (permalink / raw)
  To: 42192; +Cc: Arun Isaac

* 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





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

* [bug#42192] [PATCH 0/3] Improve launchpad updater
  2020-07-04 18:25 [bug#42192] [PATCH 0/3] Improve launchpad updater Arun Isaac
  2020-07-04 18:33 ` [bug#42192] [PATCH 1/3] import: launchpad: Handle list of source URLs correctly Arun Isaac
@ 2020-08-31 13:29 ` Ludovic Courtès
  2020-09-01 17:20   ` bug#42192: " Arun Isaac
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2020-08-31 13:29 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 42192

Hi Arun,

Arun Isaac <arunisaac@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’.




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

* bug#42192: [PATCH 0/3] Improve launchpad updater
  2020-08-31 13:29 ` [bug#42192] [PATCH 0/3] Improve launchpad updater Ludovic Courtès
@ 2020-09-01 17:20   ` Arun Isaac
  0 siblings, 0 replies; 6+ messages in thread
From: Arun Isaac @ 2020-09-01 17:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 42192-done


>> 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. :-)




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

end of thread, other threads:[~2020-09-01 17:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-04 18:25 [bug#42192] [PATCH 0/3] Improve launchpad updater Arun Isaac
2020-07-04 18:33 ` [bug#42192] [PATCH 1/3] import: launchpad: Handle list of source URLs correctly Arun Isaac
2020-07-04 18:33   ` [bug#42192] [PATCH 2/3] import: launchpad: Recognize the .orig.tar.gz extension Arun Isaac
2020-07-04 18:33   ` [bug#42192] [PATCH 3/3] import: launchpad: Recognize more URLs Arun Isaac
2020-08-31 13:29 ` [bug#42192] [PATCH 0/3] Improve launchpad updater Ludovic Courtès
2020-09-01 17:20   ` bug#42192: " Arun Isaac

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).