diff options
author | Michael Kuhn <michael.kuhn@ovgu.de> | 2022-05-15 03:01:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-14 18:01:29 -0700 |
commit | ff03e2ef4cf24c4682fdf2858d6a2be6001ac7ec (patch) | |
tree | d53fad196337c643d84220dfd7d5fdbc73f4ccd6 /lib | |
parent | bee311edf3f92d5643b191d679b3bfd3ab5ac3eb (diff) | |
download | spack-ff03e2ef4cf24c4682fdf2858d6a2be6001ac7ec.tar.gz spack-ff03e2ef4cf24c4682fdf2858d6a2be6001ac7ec.tar.bz2 spack-ff03e2ef4cf24c4682fdf2858d6a2be6001ac7ec.tar.xz spack-ff03e2ef4cf24c4682fdf2858d6a2be6001ac7ec.zip |
uninstall: fix dependency check (#30674)
The dependency check currently checks whether there are only build
dependencies left for a particular package. However, the database also
contains uninstalled packages, which can cause the check to fail.
For instance, with `bison` and `flex` having already been uninstalled,
`m4` will have the following dependents:
```
bison ('build', 'run')--> m4
flex ('build',)--> m4
libnl ('build',)--> m4
```
`bison` and `flex` should be ignored in this case because they are not
installed anymore.
Fixes #30673
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/uninstall.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index f7fbd67754..37fe98d0d0 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -235,7 +235,7 @@ def do_uninstall(env, specs, force): # If this spec is only used as a build dependency, we can uninstall return all( - dspec.deptypes == ("build",) + dspec.deptypes == ("build",) or not dspec.parent.installed for dspec in record.spec.edges_from_dependents() ) |