[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/08: import: hackage: Filter upper/mixed case dependencies too.
From: |
guix-commits |
Subject: |
08/08: import: hackage: Filter upper/mixed case dependencies too. |
Date: |
Mon, 6 Jun 2022 07:29:26 -0400 (EDT) |
lbraun pushed a commit to branch master
in repository guix.
commit 143141726e6c1b3f1170e9f4e971700e30d74375
Author: Lars-Dominik Braun <lars@6xq.net>
AuthorDate: Thu Jun 2 13:52:08 2022 +0200
import: hackage: Filter upper/mixed case dependencies too.
* guix/import/hackage.scm (filter-dependencies): Convert OWN-NAMES
to lowercase before filtering.
(hackage-module->sexp): Remove #f from OWN-NAMES, which is used for
unnamed (default) libraries.
* tests/hackage.scm (test-cabal-internal-library-ignored): Add mismatched
uppercase letters.
---
guix/import/hackage.scm | 8 +++++---
tests/hackage.scm | 7 ++++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 6e982366cf..878a7d2f9c 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -227,9 +227,10 @@ object."
list with the names of dependencies. OWN-NAMES is the name of the Cabal
package being processed and its internal libaries and is used to filter
references to itself."
- (filter (lambda (d) (not (member (string-downcase d)
+ (let ((ignored-dependencies (map string-downcase
(append own-names ghc-standard-libraries))))
- dependencies))
+ (filter (lambda (d) (not (member (string-downcase d)
ignored-dependencies)))
+ dependencies)))
(define* (hackage-module->sexp cabal cabal-hash
#:key (include-test-dependencies? #t))
@@ -250,7 +251,8 @@ the hash of the Cabal file."
(hackage-source-url name version))
(define own-names (cons (cabal-package-name cabal)
- (map cabal-library-name (cabal-package-library
cabal))))
+ (filter (lambda (x) (not (eqv? x #f)))
+ (map cabal-library-name (cabal-package-library
cabal)))))
(define hackage-dependencies
(filter-dependencies (cabal-dependencies->names cabal) own-names))
diff --git a/tests/hackage.scm b/tests/hackage.scm
index a11dd14846..ad2ee4b7f9 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -368,7 +368,8 @@ executable cabal
(test-assert "hackage->guix-package test without final newline"
(eval-test-with-cabal test-cabal-no-final-newline match-ghc-foo))
-;; Make sure internal libraries will not be part of the dependencies.
+;; Make sure internal libraries will not be part of the dependencies,
+;; ignore case.
(define test-cabal-internal-library-ignored
"name: foo
version: 1.0.0
@@ -379,8 +380,8 @@ license: BSD3
executable cabal
build-depends:
HTTP >= 4000.2.5 && < 4000.3,
- internal
-library internal
+ internAl
+library internaL
build-depends: mtl >= 2.0 && < 3
")
- branch master updated (0c6123f8aa -> 143141726e), guix-commits, 2022/06/06
- 03/08: import: cabal: Allow properties without space between key and value., guix-commits, 2022/06/06
- 04/08: import: cabal: Allow curly bracket before else statement., guix-commits, 2022/06/06
- 06/08: import: cabal: Support library names, guix-commits, 2022/06/06
- 02/08: import: cabal: Allow curly brackets in more positions., guix-commits, 2022/06/06
- 01/08: import: cabal: Support elif statement., guix-commits, 2022/06/06
- 05/08: import: cabal: Document failing syntax through tests., guix-commits, 2022/06/06
- 07/08: import: hackage: Filter internal libraries from inputs and native-inputs., guix-commits, 2022/06/06
- 08/08: import: hackage: Filter upper/mixed case dependencies too.,
guix-commits <=