diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2020-09-05 21:56:34 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2020-09-05 22:30:04 +0300 |
commit | de3c03a47160dec355d9b19ad5ca210d90c15fd7 (patch) | |
tree | 4ca6dc05b5fc9530d812bbb269f1c61ab9efccf3 /guix/import/launchpad.scm | |
parent | ab6fe9d362046231ad6f46eccfd1ea2c9c80b401 (diff) | |
parent | b8477cab7bccc4191ed3dfa3f149aec7917834d8 (diff) | |
download | guix-patches-de3c03a47160dec355d9b19ad5ca210d90c15fd7.tar guix-patches-de3c03a47160dec355d9b19ad5ca210d90c15fd7.tar.gz |
Merge remote-tracking branch 'origin/master' into staging
Diffstat (limited to 'guix/import/launchpad.scm')
-rw-r--r-- | guix/import/launchpad.scm | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm index c7375837c7..fd3cfa8444 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. ;;; @@ -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) @@ -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) @@ -66,7 +86,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) |