Skip to content

Commit

Permalink
Display the version number of packages flagged with avoid-version/dep…
Browse files Browse the repository at this point in the history
…recated yellow and crossed over
  • Loading branch information
kit-ty-kate committed Jan 7, 2025
1 parent 26290a4 commit df30e1e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/client/opamListCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,14 @@ let version_color st nv =
in
if OpamPackage.Set.mem nv st.installed then [`bold;`magenta] else
(if OpamPackage.Map.mem nv installed then [`bold] else []) @
(if is_available nv then [] else [`crossed;`red])
(if is_available nv then
match OpamSwitchState.opam_opt st nv with
| Some opam when
OpamFile.OPAM.has_flag Pkgflag_AvoidVersion opam ||
OpamFile.OPAM.has_flag Pkgflag_Deprecated opam ->
[`crossed;`yellow]
| None | Some _ -> []
else [`crossed;`red])

let mini_field_printer ?(prettify=false) ?(normalise=false) =
let module OpamPrinter = OpamPrinter.FullPos in
Expand Down

0 comments on commit df30e1e

Please sign in to comment.