Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[remove] if the remove command only use 'ocamlfind', then it is not n…

…ecessary to extract the archive again.
  • Loading branch information...
commit da0d7de9da7e634d19cdf1355c295ec274ad10df 1 parent 8e9d46c
Thomas Gazagnaire samoht authored

Showing 1 changed file with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. +10 2 src/client/opamSolution.ml
12 src/client/opamSolution.ml
@@ -205,7 +205,7 @@ let extract_package t nv =
205 205 | Result _
206 206 | Up_to_date _ -> ()
207 207 ) else
208   - OpamGlobals.msg "The pinned package has already been initialized, using the cached version.\n";
  208 + OpamGlobals.msg "Synchronization: nothing to do as the pinned package has already been initialized.\n";
209 209 let _files = OpamState.with_repository t nv (fun repo _ ->
210 210 OpamFilename.in_dir pinned_dir (fun () -> OpamRepository.copy_files repo nv)
211 211 ) in
@@ -233,7 +233,15 @@ let proceed_to_delete ~rm_build t nv =
233 233 (* We try to run the remove scripts in the folder where it was extracted
234 234 If it does not exist, we try to download and extract the archive again,
235 235 if that fails, we don't really care. *)
236   - if not (OpamFilename.exists_dir p_build) && OpamState.mem_repository t nv then (
  236 + (* We also use a small hack: if the remove command is simply 'ocamlfind remove xxx'
  237 + then, no need to extract the archive again. *)
  238 + let use_ocamlfind = function
  239 + | [] -> true
  240 + | "ocamlfind" :: _ -> true
  241 + | _ -> false in
  242 + if not (OpamFilename.exists_dir p_build)
  243 + && OpamState.mem_repository t nv
  244 + && not (List.for_all use_ocamlfind remove) then (
237 245 try extract_package t nv
238 246 with _ -> OpamFilename.mkdir p_build;
239 247 );

0 comments on commit da0d7de

Please sign in to comment.
Something went wrong with that request. Please try again.