Subject: Re: bug#48943: [PATCH] import: hackage: Support "common" field and imports
From: Ludovic Courtès <[email-masked]>
To: Philip Munksgaard <[email-masked]>
Cc: [email-masked]
Date: Fri, 25 Jun 2021 14:27:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Philip Munksgaard <[email-masked]> skribis:

> Fixes <https://issues.guix.gnu.org/48701>.
>
> * guix/import/cabal.scm (make-cabal-parser): Modify.
> (is-common): New variable.
> (lex-common): New procedure.
> (is-id): Modify.
> (eval-cabal): Modify.
> * tests/hackage.scm ("hackage->guix-package test cabal import") New test.

Applied with the change below (‘cut’ is for procedures but ‘match’ is a
macro).

Thanks!

Ludo’.

diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 22b5d164d0..e9a0179b3d 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -809,10 +809,10 @@ the ordering operation and the version."
       (if (eq? value 'false) #f #t)))
 
   (define common-stanzas
-    (filter-map (cut match <>
-                   (('section 'common common-name common)
-                    (cons common-name common))
-                   (_ #f))
+    (filter-map (match-lambda
+                  (('section 'common common-name common)
+                   (cons common-name common))
+                  (_ #f))
                 cabal-sexp))
 
   (define (eval sexp)