diff options
author | alalazo <massimiliano.culpo@googlemail.com> | 2016-04-29 14:50:35 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-10-11 01:55:25 -0700 |
commit | 74fb1029fa271197df4029d446a41b67688a8854 (patch) | |
tree | bc366d17a3b95e107697b964f0be67d0511ce172 | |
parent | b3a6e307b9b08be7a69f2bb513f2d98214339553 (diff) | |
download | spack-74fb1029fa271197df4029d446a41b67688a8854.tar.gz spack-74fb1029fa271197df4029d446a41b67688a8854.tar.bz2 spack-74fb1029fa271197df4029d446a41b67688a8854.tar.xz spack-74fb1029fa271197df4029d446a41b67688a8854.zip |
uninstall : removed global lock
-rw-r--r-- | lib/spack/spack/cmd/uninstall.py | 20 | ||||
-rw-r--r-- | lib/spack/spack/package.py | 11 |
2 files changed, 15 insertions, 16 deletions
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index 2d09b88c8e..bbcd2e787c 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -193,16 +193,14 @@ def uninstall(parser, args): if not args.packages and not args.all: tty.die("uninstall requires at least one package argument.") - with spack.installed_db.write_transaction(): + uninstall_list = get_uninstall_list(args) - uninstall_list = get_uninstall_list(args) + if not args.yes_to_all: + tty.msg("The following packages will be uninstalled : ") + print('') + spack.cmd.display_specs(uninstall_list, **display_args) + print('') + spack.cmd.ask_for_confirmation('Do you want to proceed ? ') - if not args.yes_to_all: - tty.msg("The following packages will be uninstalled : ") - print('') - spack.cmd.display_specs(uninstall_list, **display_args) - print('') - spack.cmd.ask_for_confirmation('Do you want to proceed ? ') - - # Uninstall everything on the list - do_uninstall(uninstall_list, args.force) + # Uninstall everything on the list + do_uninstall(uninstall_list, args.force) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 372f1f61a5..8c00ff9741 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1306,11 +1306,12 @@ class Package(object): raise PackageStillNeededError(self.spec, dependents) # Pre-uninstall hook runs first. - spack.hooks.pre_uninstall(self) - - # Uninstalling in Spack only requires removing the prefix. - self.remove_prefix() - spack.installed_db.remove(self.spec) + with self._prefix_write_lock(): + spack.hooks.pre_uninstall(self) + # Uninstalling in Spack only requires removing the prefix. + self.remove_prefix() + # + spack.installed_db.remove(self.spec) tty.msg("Successfully uninstalled %s" % self.spec.short_spec) # Once everything else is done, run post install hooks |