Skip to content

Instantly share code, notes, and snippets.



Last active Dec 22, 2015
What would you like to do?
Poudriere atomic repository updating

This allows for atomic package repository updates and dry-runs. It will allow the repository to be usable during a package build session without a wrapper to do symlinks with latest or clones etc.

  1. On first build, repository is converted to symlinked structure
  2. On build startup, all of .real is hardlink-copied to .shadow
  3. Package building treats .shadow as the PACKAGES directory
  4. Because the top-level files and directories are symlinked to .real, the build leaves all existing files alone during the build. Hardlinks are safe as package building only overwrites. The repo files are explicitly copied to prevent accidental incremental updates to the production repo.
  5. Once build completes, the top-level .shadow is renamed to .real_TIMESTAMP and the .current symlink is atomically moved to the new package directory.

View during build

Note that .shadow has poudriere built in it, but the .real directory does not.

./.current -> .real
./.real/Latest/pkg.txz -> ../All/pkg-1.1.4_1.txz
./.shadow/Latest/pkg.txz -> ../All/pkg-1.1.4_1.txz
./All -> .current/All
./Latest -> .current/Latest
./digests.txz -> .current/digests.txz
./packagesite.txz -> .current/packagesite.txz
./repo.txz -> .current/repo.txz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.