GNU bug report logs - #48943
[PATCH] import: hackage: Support "common" field and imports

Previous Next

Package: guix-patches;

Reported by: Philip Munksgaard <philip <at> munksgaard.me>

Date: Thu, 10 Jun 2021 08:41:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 48943-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Philip Munksgaard <philip <at> munksgaard.me>
Cc: 48943-done <at> debbugs.gnu.org
Subject: Re: bug#48943: [PATCH] import: hackage: Support "common" field and
 imports
Date: Fri, 25 Jun 2021 14:27:35 +0200
[Message part 1 (text/plain, inline)]
Hi,

Philip Munksgaard <philip <at> munksgaard.me> 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’.

[Message part 2 (text/x-patch, inline)]
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)

This bug report was last modified 3 years and 327 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.