Allow forced deactivation -- best effort unlinking

spack deactivate -f will unlink even if Spack thinks the package isn't enabled.
Made deactivate routines idempotent.
This commit is contained in:
Todd Gamblin
2015-02-16 12:41:22 -08:00
parent 8aa3afcfde
commit 614c22fc1b
4 changed files with 15 additions and 4 deletions

View File

@@ -155,5 +155,6 @@ def deactivate(self, ext_pkg, **args):
super(Python, self).deactivate(ext_pkg, **args)
exts = spack.install_layout.extension_map(self.spec)
del exts[ext_pkg.name]
self.write_easy_install_pth(exts)
if ext_pkg.name in exts: # Make deactivate idempotent.
del exts[ext_pkg.name]
self.write_easy_install_pth(exts)