summaryrefslogtreecommitdiff
path: root/lib/spack/spack/cmd/uninstall.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/cmd/uninstall.py')
-rw-r--r--lib/spack/spack/cmd/uninstall.py20
1 files changed, 9 insertions, 11 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)