mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 14:07:01 +01:00
import: composer: Handle parsing failures.
* guix/import/composer (latest-release): Handle parsing failures. Rename package to composer-package for clarity. Change-Id: I57f6fba7b05122b031177681e76cf0b5c9547736 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
979003c0f0
commit
92e4c0a00d
1 changed files with 11 additions and 8 deletions
|
@ -243,16 +243,19 @@ (define (php-package? package)
|
|||
(eq? (package-build-system package) composer-build-system)
|
||||
(string-prefix? "php-" (package-name package))))
|
||||
|
||||
(define (latest-release package)
|
||||
(define* (latest-release package #:key (version #f))
|
||||
"Return an <upstream-source> for the latest release of PACKAGE."
|
||||
(let* ((php-name (guix-package->composer-name package))
|
||||
(package (composer-fetch php-name))
|
||||
(version (composer-package-version package))
|
||||
(url (composer-source-url (composer-package-source package))))
|
||||
(upstream-source
|
||||
(package (package-name package))
|
||||
(version version)
|
||||
(urls (list url)))))
|
||||
(composer-package (composer-fetch php-name #:version version)))
|
||||
(if composer-package
|
||||
(upstream-source
|
||||
(package (composer-package-name composer-package))
|
||||
(version (composer-package-version composer-package))
|
||||
(urls (list (composer-source-url
|
||||
(composer-package-source composer-package)))))
|
||||
(begin
|
||||
(warning (G_ "failed to parse ~a~%") php-name)
|
||||
#f))))
|
||||
|
||||
(define %composer-updater
|
||||
(upstream-updater
|
||||
|
|
Loading…
Reference in a new issue