environments: don't try to modify run-env if a spec is not installed (#13589)

Fixes #13529
Fixes #13509
This commit is contained in:
Adam J. Stewart 2019-11-11 06:02:36 -06:00 committed by Todd Gamblin
parent fba963f1d1
commit b44df29316
No known key found for this signature in database
GPG Key ID: 66B24B9050FDD0B8

View File

@ -1117,7 +1117,7 @@ def add_default_view_to_shell(self, shell):
self.default_view))
for _, spec in self.concretized_specs():
if spec in self.default_view:
if spec in self.default_view and spec.package.installed:
env_mod.extend(self.environment_modifications_for_spec(
spec, self.default_view))
@ -1138,7 +1138,7 @@ def rm_default_view_from_shell(self, shell):
self.default_view).reversed())
for _, spec in self.concretized_specs():
if spec in self.default_view:
if spec in self.default_view and spec.package.installed:
env_mod.extend(
self.environment_modifications_for_spec(
spec, self.default_view).reversed())