guix-commits
[Top][All Lists]
Advanced

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

05/40: import: opam: Work around janestreet version numbers.


From: guix-commits
Subject: 05/40: import: opam: Work around janestreet version numbers.
Date: Tue, 5 Feb 2019 16:34:52 -0500 (EST)

roptat pushed a commit to branch master
in repository guix.

commit c3a191fafd88e1ecd8bf0ab0adc0cb959c038c94
Author: Julien Lepiller <address@hidden>
Date:   Fri Feb 1 15:35:45 2019 +0100

    import: opam: Work around janestreet version numbers.
    
    janestreet reversionned its packages and prefixed them with "v". Let the
    importer know about that and choose "v" versions first.
    
    * guix/import/opam.scm (find-latest-version): Work around version
    rewrite from janestreet.
    (opam->guix-package): Do not pass "v" to version number.
---
 guix/import/opam.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index fa8dc86..7b2e832 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,4 +1,3 @@
-;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -117,7 +116,11 @@ path to the repository."
                         (lambda (dir)
                           (string-join (cdr (string-split dir #\.)) "."))
                         versions)))
-        (latest-version versions))
+        ;; Workaround for janestreet re-versionning
+        (let ((v-versions (filter (lambda (version) (string-prefix? "v" 
version)) versions)))
+          (if (null? v-versions)
+            (latest-version versions)
+            (string-append "v" (latest-version (map (lambda (version) 
(substring version 1)) v-versions))))))
       (begin
         (format #t (G_ "Package not found in opam repository: ~a~%") package)
         #f))))
@@ -239,7 +242,9 @@ path to the repository."
                  (values
                   `(package
                      (name ,(ocaml-name->guix-name name))
-                     (version ,version)
+                     (version ,(if (string-prefix? "v" version)
+                                 (substring version 1)
+                                 version))
                      (source
                        (origin
                          (method url-fetch)



reply via email to

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