diff --git a/master_changes.md b/master_changes.md index d8c1c3e7fca..ed5d5463f64 100644 --- a/master_changes.md +++ b/master_changes.md @@ -33,6 +33,7 @@ New option/command/subcommand are prefixed with ◈. * Fetch sources when pinning an already pinned package with a different url when using working directory [#4542 @rjbou - fix #4484] * Don't ask for confirmation for pinning base packages (similarly makes no sense with 2.1 switch invariants) [#4571 @dra27] + * Fix version pin source retrieving: mustn't error if archive opam file is malformed [#4580 @rjbou] ## List * --silent renamed to --check [#4595 @dra27 - fix #4323] diff --git a/src/client/opamAction.ml b/src/client/opamAction.ml index 496c7716064..db1c3d31506 100644 --- a/src/client/opamAction.ml +++ b/src/client/opamAction.ml @@ -186,8 +186,8 @@ let download_package st nv = if OpamPackage.Set.mem nv st.pinned && OpamFilename.exists_dir dir && OpamStd.Option.Op.( - OpamPinned.find_opam_file_in_source nv.name dir >>= - OpamFile.OPAM.read_opt >>= + OpamPinned.find_opam_file_in_source nv.name dir >>| + OpamFile.OPAM.safe_read >>= OpamFile.OPAM.version_opt) = Some nv.version then Done None