Skip to content

Commit

Permalink
Fix ocaml#140
Browse files Browse the repository at this point in the history
This means that from now on, the contents of a package cannot be overwritten by files in packages/<package>/files/
This also means that we now need a patch mechanism to update the already existing contents (see ocaml#33).
  • Loading branch information
samoht committed Sep 19, 2012
1 parent 704191c commit 02721c4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/repositories.ml
Expand Up @@ -180,13 +180,21 @@ let make_archive ?(gener_digest = false) nv =
Dirname.copy download_dir extract_dir Dirname.copy download_dir extract_dir
); );


(* Eventually add the files/<package>/* to the extracted dir *) (* Eventually add the <package>/files/* to the extracted dir *)
log "Adding the files to the archive"; log "Adding the files to the archive";
let files = Path.R.available_files local_repo nv in let files = Path.R.available_files local_repo nv in
if files <> [] then ( if files <> [] then (
if not (Dirname.exists extract_dir) then if not (Dirname.exists extract_dir) then
Dirname.mkdir extract_dir; Dirname.mkdir extract_dir;
List.iter (fun f -> Filename.copy_in f extract_dir) files; List.iter (fun f ->
let dst = extract_dir // Basename.to_string (Filename.basename f) in
if Filename.exists dst then
Globals.warning
"Skipping %s as it already exists in %s\n"
(Filename.to_string f)
(Dirname.to_string extract_dir)
else
Filename.copy_in f extract_dir) files;
); );


(* And finally create the final archive *) (* And finally create the final archive *)
Expand Down

0 comments on commit 02721c4

Please sign in to comment.