Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
f40b0f52
Commit
f40b0f52
authored
9 years ago
by
Massimiliano Culpo
Browse files
Options
Downloads
Patches
Plain Diff
uninstall : updated documentation and error messages
parent
401dcb36
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/docs/basic_usage.rst
+31
-11
31 additions, 11 deletions
lib/spack/docs/basic_usage.rst
lib/spack/spack/cmd/uninstall.py
+4
-5
4 additions, 5 deletions
lib/spack/spack/cmd/uninstall.py
with
35 additions
and
16 deletions
lib/spack/docs/basic_usage.rst
+
31
−
11
View file @
f40b0f52
...
...
@@ -149,26 +149,46 @@ customize an installation in :ref:`sec-specs`.
``spack uninstall``
~~~~~~~~~~~~~~~~~~~~~
To uninstall a package, type ``spack uninstall <package>``. This will
completely remove the directory in which the package was installed.
To uninstall a package, type ``spack uninstall <package>``. This will
ask the user for
confirmation, and in case will
completely remove the directory in which the package was installed.
.. code-block:: sh
spack uninstall mpich
If there are still installed packages that depend on the package to be
uninstalled, spack will refuse to uninstall it. You can override this
behavior with ``spack uninstall -f <package>``, but you risk breaking
other installed packages. In general, it is safer to remove dependent
packages *before* removing their dependencies.
uninstalled, spack will refuse to uninstall it.
A line like ``spack uninstall mpich`` may be ambiguous, if multiple
``mpich`` configurations are installed. For example, if both
To uninstall a package and every package that depends on it, you may give the
`--dependents` option.
.. code-block:: sh
spack uninstall --dependents mpich
will display a list of all the packages that depends on `mpich` and, upon confirmation,
will uninstall them in the right order.
A line like
.. code-block:: sh
spack uninstall mpich
may be ambiguous, if multiple ``mpich`` configurations are installed. For example, if both
``mpich@3.0.2`` and ``mpich@3.1`` are installed, ``mpich`` could refer
to either one. Because it cannot determine which one to uninstall,
Spack will ask you to provide a version number to remove the
ambiguity. As an example, ``spack uninstall mpich@3.1`` is
unambiguous in this scenario.
Spack will ask you either to provide a version number to remove the
ambiguity or use the ``--all`` option to uninstall all of the matching packages.
You may force uninstall a package with the `--force` option
.. code-block:: sh
spack uninstall --force mpich
but you risk breaking other installed packages. In general, it is safer to remove dependent
packages *before* removing their dependencies or use the `--dependents` option.
Seeing installed packages
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/cmd/uninstall.py
+
4
−
5
View file @
f40b0f52
...
...
@@ -24,7 +24,6 @@
##############################################################################
from
__future__
import
print_function
import
sys
import
argparse
import
llnl.util.tty
as
tty
...
...
@@ -48,8 +47,8 @@ def ask_for_confirmation(message):
if
choice
==
'
y
'
:
break
elif
choice
==
'
n
'
:
sys
.
exit
(
1
)
tty
.
warn
ing
(
'
Please reply either
"
y
"
or
"
n
"'
)
raise
SystemExit
(
'
Operation aborted
'
)
tty
.
warn
(
'
Please reply either
"
y
"
or
"
n
"'
)
def
setup_parser
(
subparser
):
...
...
@@ -164,7 +163,7 @@ def uninstall(parser, args):
specs
=
spack
.
cmd
.
parse_specs
(
args
.
packages
)
# Gets the list of installed specs that match the ones give via cli
uninstall_list
=
concretize_specs
(
specs
,
args
.
all
,
args
.
force
)
# takes care of '-a' is given in the cli
dependent_list
=
installed_dependents
(
uninstall_list
)
# takes care of '-
r
'
dependent_list
=
installed_dependents
(
uninstall_list
)
# takes care of '-
d
'
# Process dependent_list and update uninstall_list
has_error
=
False
...
...
@@ -182,7 +181,7 @@ def uninstall(parser, args):
uninstall_list
=
list
(
set
(
uninstall_list
))
if
has_error
:
tty
.
die
(
'
You can use spack uninstall -
r
to uninstall these dependencies as well
'
)
tty
.
die
(
'
You can use spack uninstall -
-dependents
to uninstall these dependencies as well
'
)
if
not
args
.
yes_to_all
:
tty
.
msg
(
"
The following packages will be uninstalled :
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment