diff options
author | Saku Laesvuori <saku@laesvuori.fi> | 2023-12-03 11:45:07 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2023-12-03 16:15:29 +0100 |
commit | ab8612d99eca5c25ecbefe026b04ed9f00e3f8b5 (patch) | |
tree | 5233740e9cf5f407a57542039981abb43b16bb96 /guix | |
parent | 2c9ac9ab20c76abe570ff83f8746fa089fea3047 (diff) |
guix: import: Fix parsing Cabal files that import many stanzas
* guix/import/cabal.scm (eval-cabal)[eval]: Split imports to a
normalized list before mapping over it.
* tests/hackage.scm: Test it.
Change-Id: I39ece019251b6a23a937c8562d2d4a545a6bc7df
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Diffstat (limited to 'guix')
-rw-r--r-- | guix/import/cabal.scm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm index b969197455..d32c1c15fe 100644 --- a/guix/import/cabal.scm +++ b/guix/import/cabal.scm @@ -865,7 +865,16 @@ the ordering operation and the version." (((? string? name) values) (list name values)) ((("import" imports) rest ...) - (eval (append (append-map (cut assoc-ref common-stanzas <>) imports) + (eval (append (append-map + ;; The imports are (at least sometimes) a list with one string + ;; containing all the names separeted by commas. This splits + ;; those strings to a list of strings in the same format that is + ;; used in common-stanzas. + (cut assoc-ref common-stanzas <>) + (append-map (lambda (imports-string) + (map (compose string-downcase string-trim-both) + (string-split imports-string #\,))) + imports)) rest))) ((element rest ...) (cons (eval element) (eval rest))) |