From ca7de52c931d5bd04a9a674635ba34b06ca90870 Mon Sep 17 00:00:00 2001 From: "R. Boujbel" Date: Fri, 25 Jan 2019 15:49:34 +0100 Subject: [PATCH] pin: update source of (version) pinned directory (#3726) --- src/client/opamAction.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/opamAction.ml b/src/client/opamAction.ml index b5a8cb16ef7..4a2c42bfcaa 100644 --- a/src/client/opamAction.ml +++ b/src/client/opamAction.ml @@ -148,8 +148,14 @@ let download_package st nv = else let dir = OpamSwitchState.source_dir st nv in if OpamPackage.Set.mem nv st.pinned && - OpamFilename.exists_dir dir - then Done None + OpamFilename.exists_dir dir && + OpamStd.Option.Op.( + OpamPinned.find_opam_file_in_source nv.name dir >>= + OpamFile.OPAM.read_opt >>= + OpamFile.OPAM.version_opt) + = Some nv.version + then + Done None else (OpamUpdate.cleanup_source st (OpamPackage.Map.find_opt nv st.installed_opams)