From d4fd6caae0b50d0d0c0823168d64234a780b1a0e Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Mon, 13 May 2024 05:58:13 -0700 Subject: spack uninstall: improve error message for dependent environment (#44149) --- lib/spack/spack/cmd/uninstall.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index 62a7ac1f32..2022290057 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -239,6 +239,8 @@ def get_uninstall_list(args, specs: List[spack.spec.Spec], env: Optional[ev.Envi print() tty.info("The following environments still reference these specs:") colify([e.name for e in other_dependent_envs.keys()], indent=4) + if env: + msgs.append("use `spack remove` to remove the spec from the current environment") msgs.append("use `spack env remove` to remove environments") msgs.append("use `spack uninstall --force` to override") print() -- cgit v1.2.3-70-g09d2