environment.py: only acquire write lock when necessary (#31493)
This commit is contained in:
parent
9087224e04
commit
b2c519470b
@ -1612,9 +1612,10 @@ def install_specs(self, specs=None, **install_args):
|
|||||||
# ensure specs already installed are marked explicit
|
# ensure specs already installed are marked explicit
|
||||||
all_specs = specs or [cs for _, cs in self.concretized_specs()]
|
all_specs = specs or [cs for _, cs in self.concretized_specs()]
|
||||||
specs_installed = [s for s in all_specs if s.installed]
|
specs_installed = [s for s in all_specs if s.installed]
|
||||||
with spack.store.db.write_transaction(): # do all in one transaction
|
if specs_installed:
|
||||||
for spec in specs_installed:
|
with spack.store.db.write_transaction(): # do all in one transaction
|
||||||
spack.store.db.update_explicit(spec, True)
|
for spec in specs_installed:
|
||||||
|
spack.store.db.update_explicit(spec, True)
|
||||||
|
|
||||||
if not specs_to_install:
|
if not specs_to_install:
|
||||||
tty.msg('All of the packages are already installed')
|
tty.msg('All of the packages are already installed')
|
||||||
|
Loading…
Reference in New Issue
Block a user