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.
- On first build, repository is converted to symlinked structure
- On build startup, all of .real is hardlink-copied to .shadow
- Package building treats .shadow as the
PACKAGES
directory - 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.
- Once build completes, the top-level .shadow is renamed to .real_TIMESTAMP and the .current symlink is atomically moved to the new package directory.
Note that .shadow has poudriere built in it, but the .real directory does not.
. ./.current -> .real ./.real ./.real/All ./.real/All/beadm-0.8.5.txz ./.real/All/cblog-0.1.6_1.txz ./.real/All/ccache-3.1.9_2.txz ./.real/All/clearsilver-0.10.5.txz ./.real/All/fcgi-devkit-2.4.0.txz ./.real/All/gettext-0.18.3.txz ./.real/All/gmake-3.82_1.txz ./.real/All/libiconv-1.14_1.txz ./.real/All/libtool-2.4.2.txz ./.real/All/pkg-1.1.4_1.txz ./.real/All/tinycdb-0.78.txz ./.real/Latest ./.real/Latest/pkg.txz -> ../All/pkg-1.1.4_1.txz ./.real/digests.txz ./.real/packagesite.txz ./.real/repo.txz ./.shadow ./.shadow/.new_packages ./.shadow/All ./.shadow/All/beadm-0.8.5.txz ./.shadow/All/cblog-0.1.6_1.txz ./.shadow/All/ccache-3.1.9_2.txz ./.shadow/All/clearsilver-0.10.5.txz ./.shadow/All/fcgi-devkit-2.4.0.txz ./.shadow/All/gettext-0.18.3.txz ./.shadow/All/gmake-3.82_1.txz ./.shadow/All/libiconv-1.14_1.txz ./.shadow/All/libtool-2.4.2.txz ./.shadow/All/pkg-1.1.4_1.txz ./.shadow/All/poudriere-3.0.4.txz ./.shadow/All/tinycdb-0.78.txz ./.shadow/Latest ./.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