Skip to content
Browse files

Fix the repository the given package comes from.

Partially fix #556
  • Loading branch information...
1 parent 1d31a38 commit ee74e267c99ac0ec6b0fbbc6b6ab097846a7f859 @samoht committed Mar 27, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/client/opamClient.ml
View
9 src/client/opamClient.ml
@@ -404,6 +404,14 @@ module API = struct
let nv = OpamPackage.create name current_version in
let opam = OpamState.opam t nv in
+ (* where does it come from (eg. which repository) *)
+ let repository =
+ if OpamRepositoryName.Map.cardinal t.repositories <= 1 then
+ []
+ else
+ let repo = OpamState.with_repository t nv (fun _ r -> r.repo_name) in
+ ["repository", OpamRepositoryName.to_string repo] in
+
(* All the version of the package *)
let versions = OpamPackage.versions_of_name t.packages name in
let versions =
@@ -487,6 +495,7 @@ module API = struct
[ "package", OpamPackage.Name.to_string name ]
@ [ "version", OpamPackage.Version.to_string current_version ]
@ homepage
+ @ repository
@ authors
@ license
@ doc

0 comments on commit ee74e26

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