diff options
author | Jakub Kądziołka <kuba@kadziolka.net> | 2020-07-23 21:43:06 +0200 |
---|---|---|
committer | Jakub Kądziołka <kuba@kadziolka.net> | 2020-07-23 21:43:06 +0200 |
commit | d726b954baaeff876ce9728e00920fa45f529f9a (patch) | |
tree | 4b767b7586a1082dd2691bc33c3e45ace044e6e5 /guix/import/cpan.scm | |
parent | 9a74a7db8626bc139307d115f5cec2648f5273ad (diff) | |
parent | e165a2492d73d37c8b95d6970d453b9d88911ee6 (diff) |
Merge branch 'master' into core-updates
Conflicts:
gnu/packages/ruby.scm
Diffstat (limited to 'guix/import/cpan.scm')
-rw-r--r-- | guix/import/cpan.scm | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 6bcd2ce9eb..085467b871 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -316,25 +316,13 @@ in RELEASE, a <cpan-release> record." (let ((release (cpan-fetch (module->name module-name)))) (and=> release cpan-module->sexp))) -(define (cpan-package? package) - "Return #t if PACKAGE is a package from CPAN." - (define cpan-url? - (let ((cpan-rx (make-regexp (string-append "(" - "mirror://cpan" "|" - "https?://www.cpan.org" "|" - "https?://cpan.metacpan.org" - ")")))) - (lambda (url) - (regexp-exec cpan-rx url)))) - - (let ((source-url (and=> (package-source package) origin-uri)) - (fetch-method (and=> (package-source package) origin-method))) - (and (eq? fetch-method url-fetch) - (match source-url - ((? string?) - (cpan-url? source-url)) - ((source-url ...) - (any cpan-url? source-url)))))) +(define cpan-package? + (let ((cpan-rx (make-regexp (string-append "(" + "mirror://cpan" "|" + "https?://www.cpan.org" "|" + "https?://cpan.metacpan.org" + ")")))) + (url-predicate (cut regexp-exec cpan-rx <>)))) (define (latest-release package) "Return an <upstream-source> for the latest release of PACKAGE." |