Skip to content

sow where

Find which repositories and Dists include a package across the whole workspace.

sow where answers “which repositories and Dists carry this package?” for the whole workspace. Use it before you remove or replace a package that several repositories share, or to confirm that an add landed where you expected. Unlike sow show, it searches every repository by default and reports locations instead of the full package record.

Synopsis

sow where PACKAGE [-C|--workdir DIR] [-r|--repo NAME] [-d|--dist NAME]... [--json]
Flag Meaning Default
-C, --workdir DIR Workspace discovery start directory current directory
-r, --repo NAME Search only this repository all repositories
-d, --dist NAME Search only these Dists; repeatable all Dists
--json Output JSON false

Output

The first line echoes the reference and the number of locations; each further line is one repository that contains the package:

sow where 'rpm:centos-release-0:6-0.el6.centos.5.x86_64'
reference="rpm:centos-release-0:6-0.el6.centos.5.x86_64" locations=1
repository=demo coordinate="rpm:centos-release-0:6-0.el6.centos.5.x86_64" sha256:ffd9e7bdaa4884831a6c055ada01dac96b84c50a8d518dac409b445af5dadc16 dists=el9 built_dists=el9

dists lists the Dists of that repository that include the package in desired state; built_dists lists those whose current build includes it.

With --json, the locations are in result.locations. The top-level repository field is the repository named by -r, or null when the search spans the workspace. To list every repository/dists pair in a script:

sow where 'rpm:patroni-0:3.0.4-1.noarch' --json |
  jq -r '.result.locations[] | "\(.repository)/\(.dists | join(","))"'

Reference resolution

PACKAGE uses the same grammar as sow show: SHA-256 identity, canonical RPM/DEB coordinate, full filename, or bare name.

The reference must identify one package, meaning the same format, coordinate, and SHA-256. That one package may sit in several repositories. If the name matches different packages, narrow the search with -r or -d, or pass an exact coordinate or SHA-256.

where finds candidates through desired membership. A package removed from every selected Dist is not found, even if an older build still lists it. To inspect such a stored package, run sow show PACKAGE -r NAME without -d. A reference that matches nothing is rejected:

sow where nosuchpkg
operation rejected: managed: operation rejected: package reference "nosuchpkg" was not found in the selected Workspace scope

Exit codes

Code Trigger
0 One package and its locations printed
1 Runtime I/O failure
2 Usage error or workspace not found
5 A repository state database is unreadable or inconsistent
6 Explicit repository or Dist is not configured, or the reference matched nothing or was ambiguous

See also

Table reader