From 64045f7dec54232ece65defd2e9bdb28f5c11350 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 3 Mar 2023 12:44:30 +0100 Subject: [PATCH] The opamdiff for a duniverse attempts to parse the x-opam-monorepo-duniverse-dirs Previously, an entry pinned to a commit, such as openvpn: [ "git+https://github.com/roburio/openvpn.git#5041b2837fe299138fae95649cb812a3930be163" "openvpn" ] couldn't be decoded (since the form was assumed to be List [ URL ; DIR ; HASHES ] Now, the parser is extended to cope with List [ URL ; DIR ] as well. Seen on https://builds.robur.coop/compare/dde0380c-11f8-4e4f-8e91-d4ffcf5f4e08/35d0bddc-e118-44c5-bbba-f5e53cccca2d --- opamdiff/opamdiff.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opamdiff/opamdiff.ml b/opamdiff/opamdiff.ml index 4230d1e..04003c7 100644 --- a/opamdiff/opamdiff.ml +++ b/opamdiff/opamdiff.ml @@ -39,7 +39,11 @@ let duniverse_dirs_data = in let* dir = string ~ctx:"directory" dir in Ok (url, dir, List.rev hashes) - | _ -> Error (`Msg "expected a string or identifier") + | { pelem = List { pelem = [ url ; dir ] ; _ } ; _ } -> + let* url = string ~ctx:"url" url in + let* dir = string ~ctx:"directory" dir in + Ok (url, dir, []) + | _ -> Error (`Msg "expected a list of URL, DIR, [HASHES]") in function | { pelem = List { pelem = lbody ; _ } ; _ } ->