Pool & Metadata Views
The same package is often needed in several places. A noarch tool shipped to el8 and el9
on both x86_64 and aarch64 sits in four architecture directories of a conventional layout.
Copying it into each one multiplies storage and upload size, and the copies drift apart as
soon as one is replaced and the others are not.
A standard repository stores each package once, under pool/,
identified by the SHA-256 of its contents. Dists and architecture views contain only metadata: indexes whose entries point
back into the pool. Adding a package to another Dist writes index entries, not another file,
so the pool grows only with distinct packages and a publication uploads each one once.
flowchart LR
subgraph dists["dists/ — metadata only"]
v1["el9/x86_64/repodata"]
v2["el9/aarch64/repodata"]
v3["el8/x86_64/repodata"]
v4["el8/aarch64/repodata"]
end
pkg["pool/e/epel-release/<br/>epel-release-7-5.noarch.rpm"]
v1 --> pkg
v2 --> pkg
v3 --> pkg
v4 --> pkg
When the pool already holds a package, sow add reports it as reused and stores nothing new:
The pool belongs to one repository. Another repository, or a publication target, holds its own copy of the package. Repository layout explains how pool paths are named.
RPM views
An RPM Dist has one metadata directory per configured architecture:
demo/
pool/
- c/centos-release/centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm
- e/epel-release/epel-release-7-5.noarch.rpm
dists/el9/
x86_64/repodata/
- <sha256>-primary.xml.gz
- <sha256>-filelists.xml.gz
- <sha256>-other.xml.gz
- repomd.xml
aarch64/repodata/
- ...
The x86_64 view lists the x86_64 and noarch packages, and the aarch64 view lists the
aarch64 and noarch packages. Both refer to the same noarch file. Each location is
relative to the architecture directory, so it climbs back to the repository root:
A YUM client uses the architecture directory as its base URL, for example
baseurl=https://repo.example.com/demo/dists/el9/$basearch/. sow check verifies that every
indexed location stays inside the repository and resolves to the expected package object.
APT views
APT indexes use paths relative to the repository root:
Each configured architecture has Packages, Packages.gz, and SHA-256 by-hash entries under
dists/<dist>/main/binary-<arch>/. The Dist root holds Release and, when metadata signing is
configured, InRelease and Release.gpg. An APT source therefore names the repository root as
its URIs value and the Dist as its suite.
Architecture all packages appear in each applicable architecture index while their file
stays one pool object. SOW creates no per-view package copies and no per-architecture
Release files.
Deliver the complete repository
The shared pool imposes one rule: clients must reach pool/ and dists/ at the same
relative positions they have on disk. RPM locations climb out of the architecture directory,
and APT Filename values start at the repository root, so serving or copying only
dists/el9/x86_64/, or only dists/, leaves every package download unresolved. Serve the
repository directory itself, here demo/, and copy it whole.
For live updates, use a configured publication target. sow publish uploads packages and
immutable metadata before it switches the client entry points, and handles the cache grace
for old files; see Serve and publish.
For any other transport, copy the complete, settled pool/ and dists/ tree into a new
staging directory, verify the copy, then switch it into service as a unit. Keep the package
URLs that cached indexes reference reachable until those caches expire. sow changes 0 lists
every file of the current build, each pool package once, then metadata, then client entry
points, so it doubles as the manifest to verify against.
Deliver to an isolated host has the
complete procedure.
Removing a Dist or architecture that a target has already published requires retiring that target first; see Removing a published view.
Export for dnf reposync
dnf and apt follow those relative paths without trouble, but default dnf reposync does
not: it confines downloads to one directory per repository and rejects a location that climbs
above it. For that workflow, sow export rpm-leaf writes a standalone copy of one RPM view,
with its own pool/ and an index that uses local paths. The destination’s parent directory
must already exist:
/srv/exports/el9-x86_64/
- .sow-export.jsoncompletion marker and provenance
- manifest.tsv
pool/
- c/centos-release/centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm
- e/epel-release/epel-release-7-5.noarch.rpm
- repodata/locations such as pool/e/epel-release/epel-release-7-5.noarch.rpm
The repository needs a completed Generation, no unfinished operation, and no membership
changes waiting for a build; the export always reads the last build.
An RPM Dist whose last build is older than the current Generation still exports, because SOW
carries an unchanged view forward into each new Generation. The destination must be absent
or empty, and it must lie outside the repository, the private state, and the prospective root
(endpoint + prefix) of every configured filesystem target. sow export
lists every condition and exit code.
Export copies files by default. --hardlink requires the same filesystem and makes the
exported packages share the source inodes, so keep them read-only. An export is a separate
delivery artifact: it creates no Dist membership or retained Generation, does not protect
source packages from gc, and is not input to sow publish.
Every path mentioned here is listed in Repository layout.