guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: import: launchpad: Recognize more URLs.


From: guix-commits
Subject: 03/03: import: launchpad: Recognize more URLs.
Date: Tue, 1 Sep 2020 13:19:34 -0400 (EDT)

arunisaac pushed a commit to branch master
in repository guix.

commit 4546c0dd2f58fe9a1b1e78120a33b8c276970f62
Author: Arun Isaac <arunisaac@systemreboot.net>
AuthorDate: Sat Jul 4 23:44:59 2020 +0530

    import: launchpad: Recognize more URLs.
    
    * 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 c991ccf..fd3cfa8 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]