Skip to content

Repository Layout

Where package files, indexes, private state, and publication output live, and which of them to serve.

Every path SOW reads or writes, in a simple repository and in a workspace of standard repositories. Look here when you configure a web server, write backup or sync rules, or need to find a file that a diagnostic names. For a standard repository, the rule that matters most: serve <workspace>/<repo>/, which holds pool/ and dists/, and keep sow.yml and .sow/ outside the web server’s document root.

Simple repository

  • /srv/offline/
    • example-1.0-1.x86_64.rpm
    • example_1.0-1_amd64.deb
    • repodata/
      • <sha256>-primary.xml.gz
      • <sha256>-filelists.xml.gz
      • <sha256>-other.xml.gz
      • repomd.xml
    • Packages
    • Packages.gz
    • repo_completewith --pigsty

sow create writes indexes next to the packages: RPM metadata only when the directory holds RPMs, DEB metadata only when it holds DEBs. Index entries are relative (a bare file name for RPM, ./<file name> for DEB), so the directory works at any URL. sow prune removes older RPMs from the same directory and rewrites only the RPM index.

SOW also keeps a few private files in a simple repository:

Path Purpose Serve or copy
.sow-plain-stage-*/ Staging while create runs; a later create removes stale ones Exclude
.sow-prune-repo-complete Tracks the completion marker while prune runs Exclude
.sow-plain-rpm-history.json Current and previous RPM metadata references Keep it with a copy you will run create or prune on

The history file is not part of any client index and is not a recovery journal.

Workspace and standard repositories

  • <workspace>/
    • sow.ymlworkspace configuration
    • .sow/private state
      • workspace.lock
      • workspace-ops/
      • repo-locks/<repo>.lock
      • <repo>.db
      • <repo>/
        • abandoned/retained migration stages
        • stage/active staging and retain-remove-* removal plans/tombstones
        • recovery/active local GC plans (<operation-id>/plan.json) and detached payloads
        • retained/retained generation records
        • transitions/
        • pending/
    • <repo>/public repository root
      • pool/
      • dists/
Path under .sow/ Holds
workspace.lock, repo-locks/<repo>.lock Advisory locks; SOW coordinates processes through these fixed paths, so leave them in place
workspace-ops/ Workspace lifecycle journal for init, repo new, and repo rm
<repo>.db Repository database: membership, builds, operation journal, publication state. SQLite WAL and shared-memory sidecar files can sit beside it
<repo>/pending/ New package files waiting for a build to move them into the pool
<repo>/stage/, recovery/, transitions/, abandoned/ Work in progress and recovery material for builds, GC, retain rm, and layout migration
<repo>/retained/ Records of Generations kept with retain

.sow/ and the pending directories are private (0700). Pending package files are 0644, so a build can move them into public paths without changing their mode.

SOW 0.9.0 uses database schema v13 and configuration schema sow/v3 (in sow.yml or sow.yaml); the two version numbers are independent. The database only makes sense together with the private and public files it describes, so back up and restore the workspace as a whole, and do it before repo migrate. Do not edit the schema version or the rebuildable cache by hand.

Package pool

pool/<prefix>/<source>/<filename>

Each repository stores every package once, in its own pool. Every Dist and architecture index points at that one file, so a noarch package shared by five views is still one copy.

source comes from the RPM SOURCERPM or DEB Source field, normalized to a source package name; without one, SOW uses the binary package name. The prefix is the first character in lowercase, except that a source starting with lowercase lib uses its first four characters (or the whole name, if shorter), also in lowercase.

Source Example path
postgresql-18 pool/p/postgresql-18/libpq5_18.3-1_amd64.deb
example pool/e/example/example-1.0-1.x86_64.rpm
libfoo pool/libf/libfoo/libfoo1_1.0-1_amd64.deb

Pool files are immutable. Removing a package from a Dist does not delete its bytes, because built, retained, recovery, and publication records can still reference them; gc deletes them once no record does.

RPM Dist

  • dists/el9/
    • x86_64/repodata/
      • <sha256>-primary.xml.gz
      • <sha256>-filelists.xml.gz
      • <sha256>-other.xml.gz
      • repomd.xml
      • repomd.xml.ascwith metadata signing
    • aarch64/repodata/

Architecture views hold metadata only. Each package location points back to the pool:

<location href="../../../pool/e/example/example-1.0-1.x86_64.rpm"/>

A native package appears in its own architecture’s view; a noarch package appears in every configured view. Older checksum-named metadata files can remain next to the current ones, and repomd.xml selects the active set. For a self-contained directory with local package paths, use export rpm-leaf.

DEB Dist

  • dists/trixie/
    • Release
    • InReleasewith metadata signing
    • Release.gpgwith metadata signing
    • main/
      • binary-amd64/
        • Packages
        • Packages.gz
        • by-hash/SHA256/<digest>
      • binary-arm64/

Packages entries use paths relative to the repository root, such as Filename: pool/e/example/example_1.0-1_amd64.deb. Release lists SHA-256 checksums and sets Acquire-By-Hash: yes. An architecture all package appears in every applicable index.

Publication paths

Both target providers receive the same public layout under the target’s prefix:

  • <prefix>/
    • pool/
    • dists/

An export is different: it has its own package files, metadata, manifest, and a .sow-export.json completion marker. It is a separate delivery artifact, not another standard repository.

Names and case sensitivity

Repository, Dist, and target names become path components, so they follow the naming rules in the configuration reference; the reserved names (.sow, pool, dists, sow.yml, and others) keep them from colliding with the paths above.

SOW rejects a new pool path that differs only in case from an existing one, even with identical bytes. On a case-insensitive filesystem, source directories that differ only in case also conflict. On a case-sensitive filesystem they can coexist, so check for them before you move a repository to a case-insensitive volume.

See Pool and metadata views, Serve and publish, and Platforms and integrations.

Table reader