Skip to content

Commit

Permalink
The new repositories should always have the highest priority
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed Mar 5, 2013
1 parent 136b300 commit 26b056b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/opamRepositoryCommand.ml
Expand Up @@ -149,8 +149,12 @@ let add name kind address ~priority:prio =
log "Adding %s" (OpamRepository.to_string repo);
update_config t (repo.repo_name :: OpamRepositoryName.Map.keys t.repositories);
try
let max_prio =
OpamRepositoryName.Map.fold
(fun _ { repo_priority } m -> max repo_priority m)
t.repositories min_int in
let prio = match prio with
| None -> 10 * (OpamRepositoryName.Map.cardinal t.repositories);
| None -> 10 + max_prio
| Some p -> p in
OpamState.remove_state_cache ();
!OpamState.update_hook ~save_cache:false [name];
Expand Down

0 comments on commit 26b056b

Please sign in to comment.