import: hackage: Return multiple values for unknown packages.

Partly fixes <https://bugs.gnu.org/44115>.

* guix/import/hackage.scm (hackage->guix-package): Return 'values'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
zimoun 2021-01-19 16:47:18 +01:00 committed by Ludovic Courtès
parent 434925379d
commit 6bb92098b4
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,7 @@
;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2019 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -337,10 +338,13 @@ respectively."
(if port
(read-cabal-and-hash port)
(hackage-fetch-and-hash package-name))))
(and=> cabal-meta (compose (cut hackage-module->sexp <> cabal-hash
#:include-test-dependencies?
include-test-dependencies?)
(cut eval-cabal <> cabal-environment)))))
(if cabal-meta
((compose (cut hackage-module->sexp <> cabal-hash
#:include-test-dependencies?
include-test-dependencies?)
(cut eval-cabal <> cabal-environment))
cabal-meta)
(values #f '()))))
(define hackage->guix-package/m ;memoized variant
(memoize hackage->guix-package))