From c3a191fafd88e1ecd8bf0ab0adc0cb959c038c94 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 1 Feb 2019 15:35:45 +0100 Subject: [PATCH] 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 fa8dc86d32..7b2e832e92 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 ;;; ;;; This file is part of GNU Guix. @@ -117,7 +116,11 @@ (define (find-latest-version package 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 @@ (define (opam->guix-package name) (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)