From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: 32387@debbugs.gnu.org
Cc: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Subject: bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing.
Date: Tue, 7 Aug 2018 18:00:16 +0200 [thread overview]
Message-ID: <20180807160016.28728-1-ricardo.wurmus@mdc-berlin.de> (raw)
In-Reply-To: <idj36vq8h0l.fsf@bimsb-sys02.mdc-berlin.net>
Fixes <https://debbugs.gnu.org/32387>.
* guix/import/cabal.scm (eval-cabal): Avoid mis-match when the custom-setup
section cannot be created.
* guix/import/hackage.scm (cabal-custom-setup-dependencies->names): Do not
crash when cabal-package-custom-setup returns #F.
---
guix/import/cabal.scm | 7 ++++---
guix/import/hackage.scm | 6 ++++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 1b8bda6f4..13c2f3f48 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -831,9 +832,9 @@ See the manual for limitations.")))))))
(test-suites (make-cabal-section evaluated-sexp 'test-suite))
(flags (make-cabal-section evaluated-sexp 'flag))
(eval-environment '())
- (custom-setup (match
- (make-cabal-section evaluated-sexp 'custom-setup)
- ((x) x))))
+ (custom-setup (match (make-cabal-section evaluated-sexp 'custom-setup)
+ ((x) x)
+ (_ #f))))
(make-cabal-package name version license home-page-or-hackage
source-repository synopsis description executables lib
test-suites flags eval-environment custom-setup)))
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 6f80d84b7..3b138f8c9 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -178,8 +179,9 @@ object."
(define (cabal-custom-setup-dependencies->names cabal)
"Return the list of custom-setup dependencies from the CABAL package
object."
- (let* ((custom-setup-dependencies (and=> (cabal-package-custom-setup cabal)
- cabal-custom-setup-dependencies)))
+ (let* ((custom-setup-dependencies (or (and=> (cabal-package-custom-setup cabal)
+ cabal-custom-setup-dependencies)
+ '())))
(map cabal-dependency-name custom-setup-dependencies)))
(define (filter-dependencies dependencies own-name)
--
2.18.0
next prev parent reply other threads:[~2018-08-07 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 13:04 bug#32387: hackage/cabal importer broken Ricardo Wurmus
2018-08-07 16:00 ` Ricardo Wurmus [this message]
2018-08-07 16:19 ` bug#32387: [PATCH] import: cabal, hackage: Avoid error when custom setup section is missing Danny Milosavljevic
2018-08-07 21:04 ` bug#32387: hackage/cabal importer broken Ricardo Wurmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180807160016.28728-1-ricardo.wurmus@mdc-berlin.de \
--to=ricardo.wurmus@mdc-berlin.de \
--cc=32387@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).