guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/05: guix: opam: Pass default repository to recursive importer.


From: guix-commits
Subject: 03/05: guix: opam: Pass default repository to recursive importer.
Date: Tue, 8 Dec 2020 10:57:06 -0500 (EST)

roptat pushed a commit to branch master
in repository guix.

commit 15ee1b8317adeb74938f3bb7f0c7cb635a818292
Author: Julien Lepiller <julien@lepiller.eu>
AuthorDate: Tue Dec 8 13:58:49 2020 +0100

    guix: opam: Pass default repository to recursive importer.
    
    * guix/import/opam.scm (opam->guix-package): Rename #:repository key
    to #:repo.
    (opam-recursive-import): Pass #:repo keyword.
    * tests/opam.scm (opam->guix-package): Rename #:repository to #:repo.
---
 guix/import/opam.scm | 9 +++++----
 tests/opam.scm       | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 4f366a9..6e98822 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -264,11 +264,11 @@ path to the repository."
                         (substring version 1)
                         version)))))
 
-(define* (opam->guix-package name #:key (repository (get-opam-repository)) 
version)
+(define* (opam->guix-package name #:key (repo (get-opam-repository)) version)
   "Import OPAM package NAME from REPOSITORY (a directory name) or, if
 REPOSITORY is #f, from the official OPAM repository.  Return a 'package' sexp
 or #f on failure."
-  (and-let* ((opam-file (opam-fetch name repository))
+  (and-let* ((opam-file (opam-fetch name repo))
              (version (assoc-ref opam-file "version"))
              (opam-content (assoc-ref opam-file "metadata"))
              (url-dict (metadata-ref opam-content "url"))
@@ -323,10 +323,11 @@ or #f on failure."
                         (not (member name '("dune" "jbuilder"))))
                       dependencies))))))))
 
-(define (opam-recursive-import package-name)
+(define* (opam-recursive-import package-name #:repo (get-opam-repository))
   (recursive-import package-name
                     #:repo->guix-package opam->guix-package
-                    #:guix-name ocaml-name->guix-name))
+                    #:guix-name ocaml-name->guix-name
+                    #:repo repo))
 
 (define (guix-name->opam-name name)
   (if (string-prefix? "ocaml-" name)
diff --git a/tests/opam.scm b/tests/opam.scm
index ec2a668..8d43e2c 100644
--- a/tests/opam.scm
+++ b/tests/opam.scm
@@ -85,7 +85,7 @@ url {
         (with-output-to-file (string-append my-package "/opam")
           (lambda _
             (format #t "~a" test-opam-file))))
-      (match (opam->guix-package "foo" #:repository test-repo)
+      (match (opam->guix-package "foo" #:repo test-repo)
         (('package
            ('name "ocaml-foo")
            ('version "1.0.0")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]