Skip to content

Commit

Permalink
[update] Fix association between packages and repositories
Browse files Browse the repository at this point in the history
Now, changing repository priorities in ~/.opam/repo/index + `opam update` works as expected.
  • Loading branch information
samoht committed Sep 10, 2012
1 parent ecc1ac6 commit 81bf0d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,12 @@ let update_repo_index t =
) (Path.G.available_aliases t.global) NV.Set.empty in
NV.Set.iter (fun nv ->
if not (NV.Set.mem nv all_installed) then (
Filename.remove (Path.G.opam t.global nv);
Filename.remove (Path.G.descr t.global nv);
Filename.remove (Path.G.archive t.global nv);
let opam_g = Path.G.opam t.global nv in
let descr_g = Path.G.descr t.global nv in
let archive_g = Path.G.archive t.global nv in
Filename.remove opam_g;
Filename.remove descr_g;
Filename.remove archive_g;
);
) (Path.G.available_packages t.global);

Expand All @@ -390,6 +393,7 @@ let update_repo_index t =
let available_versions = Path.R.available_versions repo_p n in
V.Set.iter (fun v ->
if not (V.Set.mem v !all_versions) then (
all_versions := V.Set.add v !all_versions;
let nv = NV.create n v in
let opam_g = Path.G.opam t.global nv in
let descr_g = Path.G.descr t.global nv in
Expand Down
4 changes: 3 additions & 1 deletion src/repo/rsync.ml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ module B = struct
if not (Filename.exists archive) then
false
else match download_archive address nv with
| Not_available -> false
| Not_available ->
Filename.remove archive;
false
| Up_to_date _ -> false
| Result _ -> true
) available_packages in
Expand Down

0 comments on commit 81bf0d3

Please sign in to comment.