From 9c2cf5b074aeb666dfeb44c946752debc79b37e5 Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 18 Jan 2020 18:44:45 +0000 Subject: [PATCH 1/2] Copy files instead of rsync when they are in a local cache --- src/repository/opamRepository.ml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/repository/opamRepository.ml b/src/repository/opamRepository.ml index e2d4da20120..f16c4c07e6d 100644 --- a/src/repository/opamRepository.ml +++ b/src/repository/opamRepository.ml @@ -80,9 +80,15 @@ let fetch_from_cache = ~quiet:true ~validate:false ~overwrite:true ~checksum url file | `rsync -> - (OpamLocal.rsync_file url file @@| function - | Result _ | Up_to_date _-> () - | Not_available (s,l) -> raise (OpamDownload.Download_fail (s,l))) + begin match OpamUrl.local_file url with + | Some src -> + OpamFilename.copy ~src ~dst:file; + OpamProcess.Job.Op.Done () + | None -> + (OpamLocal.rsync_file url file @@| function + | Result _ | Up_to_date _-> () + | Not_available (s,l) -> raise (OpamDownload.Download_fail (s,l))) + end | #OpamUrl.version_control -> failwith "Version control not allowed as cache URL" in From f42a368d07af6a301d1317b030114c3cbd1b1dab Mon Sep 17 00:00:00 2001 From: Kate Date: Fri, 10 Jul 2020 16:14:02 +0100 Subject: [PATCH 2/2] Update master_changes.md --- master_changes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/master_changes.md b/master_changes.md index 5be08a3486a..2b12b04f450 100644 --- a/master_changes.md +++ b/master_changes.md @@ -20,6 +20,9 @@ Possibly scripts breaking changes are prefixed with ✘ * Add `_build` to rsync exclusion list [#4230 @rjobou - fix #4195] * Recursive opam file lookup: ignore `_build` [#4230 @rjbou] +## Archives fetch + * Copy instead of calling rsync when archives are in a local cache [#4270 @kit-ty-kate] + ## Switch * Fix Not_found with `opam switch create . --deps` [#4151 @AltGr] * Package Var: resolve self `name` variable for orphan packages [#4228 @rjbou - fix #4224]