spack/share/spack
Peter Scheibel 56a1663cd9
spack find -c: search all concretized-but-not-installed specs (#44713)
Originally if you had `x -> y -> z`, and an env with `x` in its speclist that is concretized but not installed, then `spack find -c y` would not show anything. This was intended: `spack find` has up-until-now only ever listed out installed specs (and `-c` was for adding a preamble section about roots).

This changes `spack find` so:

* `-c` makes it search through all concretized specs in the env (in a sense it is anticipated that a concretized environment would serve as a "speculative" DB and users may want to query it like they query the DB outside of envs)
* Adds a `-i/--install-status` option, equivalent to `-I` from `spack spec`
* Shows install status for either `-c` or `-i`
* As a side effect to prior point, `spack find -i` can now distinguish different installation states (upstream/external)

Examples:

```
$ spack find -r
==> In environment findtest
==> 1 root specs
 -  raja

==> 6 installed packages (not shown)
==> 12 concretized packages to be installed (not shown)
```

```
$ spack find
==> In environment findtest
==> 1 root specs
 -  raja

-- darwin-ventura-m1 / apple-clang@14.0.3 -----------------------
berkeley-db@18.1.40  bzip2@1.0.8  diffutils@3.10  gmake@4.4.1  gnuconfig@2022-09-17  libiconv@1.17
==> 6 installed packages
==> 12 concretized packages to be installed (show with `spack find -c`)
```

```
$ spack find -c
==> In environment findtest
==> 1 root specs
 -  raja

-- darwin-ventura-m1 / apple-clang@14.0.3 -----------------------
[+]  berkeley-db@18.1.40  [+]  bzip2@1.0.8      -   cmake@3.29.4  [+]  diffutils@3.10  [+]  gmake@4.4.1           [+]  libiconv@1.17   -   nghttp2@1.62.0   -   pkgconf@2.2.0    -   readline@8.2
 -   blt@0.6.2             -   camp@2024.02.1   -   curl@8.7.1     -   gdbm@1.23       [+]  gnuconfig@2022-09-17   -   ncurses@6.5     -   perl@5.38.2      -   raja@2024.02.2   -   zlib-ng@2.1.6
==> 6 installed packages
==> 12 concretized packages to be installed


```
$ spack -E find
...
==> 82 installed packages
```
2024-07-09 11:53:20 -07:00
..
bash Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
bootstrap Update bootstrap buildcache to support Python 3.12 (#40404) 2023-10-11 19:03:17 +02:00
csh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
docker Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
docs/docker/module-file-tutorial Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
fish Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
gitlab/cloud_pipelines [openfoam]: use latest cgal (#45003) 2024-07-03 14:04:38 -07:00
keys update tutorial command for v0.18.0 and new gpg key (#30904) 2022-05-28 02:36:20 +00:00
logo
qa Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
templates containers: rm centos7 since EOL (#45049) 2024-07-04 22:22:23 +02:00
setup-env.csh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-env.fish Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-env.ps1 Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
setup-env.sh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-tutorial-env.sh Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
spack-completion.bash spack find -c: search all concretized-but-not-installed specs (#44713) 2024-07-09 11:53:20 -07:00
spack-completion.fish spack find -c: search all concretized-but-not-installed specs (#44713) 2024-07-09 11:53:20 -07:00