me
/
guix
Archived
1
0
Fork 0

import: launchpad: Recognize more URLs.

* guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs.
master
Arun Isaac 2020-07-04 23:44:59 +05:30
parent 4322561243
commit 4546c0dd2f
No known key found for this signature in database
GPG Key ID: 2E25EE8B61802BB3
1 changed files with 26 additions and 6 deletions

View File

@ -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)