fixed installed dependents and uninstall error message
This commit is contained in:
parent
d224718d96
commit
2aa859e0cf
1 changed files with 3 additions and 5 deletions
|
@ -543,9 +543,7 @@ def installed_dependents(self):
|
||||||
dependents = []
|
dependents = []
|
||||||
for spec in spack.db.installed_package_specs():
|
for spec in spack.db.installed_package_specs():
|
||||||
if self.name in spec.dependencies:
|
if self.name in spec.dependencies:
|
||||||
dep_spec = spec.dependencies[self.name]
|
dependents.append(spec)
|
||||||
if self.spec == dep_spec:
|
|
||||||
dependents.append(dep_spec)
|
|
||||||
return dependents
|
return dependents
|
||||||
|
|
||||||
|
|
||||||
|
@ -772,8 +770,8 @@ def do_uninstall(self):
|
||||||
if not self.ignore_dependencies:
|
if not self.ignore_dependencies:
|
||||||
deps = self.installed_dependents
|
deps = self.installed_dependents
|
||||||
if deps: tty.die(
|
if deps: tty.die(
|
||||||
"Cannot uninstall %s. The following installed packages depend on it:"
|
"Cannot uninstall %s. The following installed packages depend on it: %s"
|
||||||
% self.name, " ".join(deps))
|
% (self.name, deps))
|
||||||
|
|
||||||
self.remove_prefix()
|
self.remove_prefix()
|
||||||
tty.msg("Successfully uninstalled %s." % self.name)
|
tty.msg("Successfully uninstalled %s." % self.name)
|
||||||
|
|
Loading…
Reference in a new issue