Permalink
Browse files

On 'opam info' show when a package is pinned.

This can help debugging weird situation when we forgot that we've pinned some packages.
  • Loading branch information...
samoht committed Mar 27, 2013
1 parent 23c3455 commit 83ce3bdb612a69b8adbaa9b9c81979810aacf795
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/client/opamClient.ml
View
@@ -364,8 +364,13 @@ module API = struct
let installed =
OpamSwitch.Map.fold (fun switch _ map ->
let installed = OpamFile.Installed.safe_read (OpamPath.Switch.installed t.root switch) in
+ let pinned = OpamFile.Pinned.safe_read (OpamPath.Switch.pinned t.root switch) in
if OpamState.mem_installed_package_by_name_aux installed name then
- let nv = OpamState.find_installed_package_by_name_aux installed name in
+ let nv =
+ if OpamPackage.Name.Map.mem name pinned then
+ OpamPackage.create name (OpamPackage.Version.of_string "(pinned)")
+ else
+ OpamState.find_installed_package_by_name_aux installed name in
if OpamPackage.Map.mem nv map then
let aliases = OpamPackage.Map.find nv map in
let map = OpamPackage.Map.remove nv map in

0 comments on commit 83ce3bd

Please sign in to comment.