spack/share/spack
Todd Gamblin 24d12c632c
spack gc: add options for environments and build dependencies (#41731)
This adds a few options to `spack gc`.

One to give you a little more control over dependencies:

* `-b` / `--keep-build-dependencies`: By default, `spack gc` considers build dependencies to be "no longer needed" once their dependents are installed. With this option, we'll keep build dependencies of needed installations as well.

And two more to make working with environments easier:

* `-E` / `--except-any-environment`: Garbage collect anything NOT needed by an environment. `spack gc -E` and `spack gc -bE` are now easy ways to get rid of everytihng not used by some environment.

* `-e` / `--except-environment` `ENV`: Instead of considering all environments, garbage collect everything not needed by a *specific* environment. Note that you can use this with `-E` to add directory environments to the list of considered envs, e.g.:

      spack gc -E -e /path/to/direnv1 -e /path/to/direnv2 #...

- [x] rework `unused_specs()` method on DB to add options for roots and deptypes
- [x] add `all_hashes()` method on DB
- [x] rework `spack gc` command to add 3 more options
- [x] tests
2023-12-26 14:52:10 -08:00
..
bash bugfix: compress aliases for first command in completion (#40890) 2023-11-05 10:15:37 +00:00
bootstrap Update bootstrap buildcache to support Python 3.12 (#40404) 2023-10-11 19:03:17 +02:00
csh macos sip: apply on macos only, dont store LD_LIBRARY_PATH (#38687) 2023-07-04 10:54:13 +02:00
docker license year bump (#34921) 2023-01-18 14:30:17 -08:00
docs/docker/module-file-tutorial license year bump (#34921) 2023-01-18 14:30:17 -08:00
fish Fix suffix of tab completion scripts (#39154) 2023-08-09 08:28:55 -05:00
gitlab Revert "CI: Disable downloading artifacts from upstream jobs (#41432)" (#41843) 2023-12-23 00:21:19 +01:00
keys update tutorial command for v0.18.0 and new gpg key (#30904) 2022-05-28 02:36:20 +00:00
logo add artisanal handcrafted SVG Spack logo. (#6165) 2017-11-06 22:42:16 -08:00
qa spack env activate: create & activate default environment without args (#40756) 2023-11-05 22:53:26 -08:00
templates Do not use depfile in bootstrap (#41458) 2023-12-07 10:09:49 +00:00
setup-env.csh license year bump (#34921) 2023-01-18 14:30:17 -08:00
setup-env.fish Revert "Add style tool to fix fish file formatting (#39155)" (#39680) 2023-08-29 18:12:19 +02:00
setup-env.ps1 Windows: Add PowerShell env support (#37951) 2023-06-27 18:26:51 -07:00
setup-env.sh spack env activate: create & activate default environment without args (#40756) 2023-11-05 22:53:26 -08:00
setup-tutorial-env.sh license year bump (#34921) 2023-01-18 14:30:17 -08:00
spack-completion.bash spack gc: add options for environments and build dependencies (#41731) 2023-12-26 14:52:10 -08:00
spack-completion.fish spack gc: add options for environments and build dependencies (#41731) 2023-12-26 14:52:10 -08:00