From df30e1ecde11d4d5171f5b145e4d58572991f3c5 Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 7 Jan 2025 19:56:56 +0000 Subject: [PATCH] Display the version number of packages flagged with avoid-version/deprecated yellow and crossed over --- src/client/opamListCommand.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/opamListCommand.ml b/src/client/opamListCommand.ml index 5c51a333d76..027dd0a3fcd 100644 --- a/src/client/opamListCommand.ml +++ b/src/client/opamListCommand.ml @@ -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