Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the version number of packages flagged with avoid-version/deprecated yellow and crossed over #6358

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading