aboutsummaryrefslogtreecommitdiff
path: root/guix/import/launchpad.scm
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2020-07-04 23:44:59 +0530
committerArun Isaac <arunisaac@systemreboot.net>2020-09-01 22:45:16 +0530
commit4546c0dd2f58fe9a1b1e78120a33b8c276970f62 (patch)
tree773c44d4e155562951d4f34ef0a97baf4aef720d /guix/import/launchpad.scm
parent43225612437a345f211468ca696e150387640f52 (diff)
downloadguix-4546c0dd2f58fe9a1b1e78120a33b8c276970f62.tar
guix-4546c0dd2f58fe9a1b1e78120a33b8c276970f62.tar.gz
import: launchpad: Recognize more URLs.
* guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs.
Diffstat (limited to 'guix/import/launchpad.scm')
-rw-r--r--guix/import/launchpad.scm32
1 files 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)