Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new pkg repo file hash ability to poudriere.conf Default to off #786

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/etc/poudriere.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,13 @@ DISTFILES_CACHE=/usr/ports/distfiles
# processing of the queue slightly, especially for bulk -a builds.
# Default: no
#HTML_TRACK_REMAINING=yes

# Have pkg create hashed versions of the pkg filenames with symlinks to
# original pkg names. The packagesite.yaml file will point to the hashed version
# of these files. By using hashed pkg filenames, this allows users to lazily
# synchronise packages without conflicting with the current packages,
# for example using rsync or CDNs. Once the packages are synced the much
# smaller meta files can then be synced. Allowing a near atomic update of repo.
# On caching cdn this means a need to purge 2-5 files instead of all pkgs that
# have been updated.
#PKG_HASH=no
10 changes: 7 additions & 3 deletions src/share/poudriere/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7664,6 +7664,9 @@ build_repo() {
local origin

msg "Creating pkg repository"
if [ ${PKG_HASH} != no ] ; then
REPO_OPTIONS="-h -s"
fi
[ ${DRY_RUN} -eq 1 ] && return 0
bset status "pkgrepo:"
ensure_pkg_installed force_extract || \
Expand All @@ -7680,20 +7683,20 @@ build_repo() {
if [ -n "${PKG_REPO_SIGNING_KEY}" ]; then
install -m 0400 ${PKG_REPO_SIGNING_KEY} \
${MASTERMNT}/tmp/repo.key
injail ${PKG_BIN} repo -o /tmp/packages \
injail ${PKG_BIN} repo ${REPO_OPTIONS} -o /tmp/packages \
${PKG_META} \
/packages /tmp/repo.key
unlink ${MASTERMNT}/tmp/repo.key
elif [ "${PKG_REPO_FROM_HOST:-no}" = "yes" ]; then
# Sometimes building repo from host is needed if
# using SSH with DNSSEC as older hosts don't support
# it.
${MASTERMNT}${PKG_BIN} repo \
${MASTERMNT}${PKG_BIN} repo ${REPO_OPTIONS} \
-o ${MASTERMNT}/tmp/packages ${PKG_META_MASTERMNT} \
${MASTERMNT}/packages \
${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}}
else
JNETNAME="n" injail ${PKG_BIN} repo \
JNETNAME="n" injail ${PKG_BIN} repo ${REPO_OPTIONS}\
-o /tmp/packages ${PKG_META} /packages \
${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}}
fi
Expand Down Expand Up @@ -8102,6 +8105,7 @@ if [ "$(mount -t fdescfs | awk '$3 == "/dev/fd" {print $3}')" = "/dev/fd" ]; the
fi

: ${OVERLAYSDIR:=/overlays}
: ${PKG_HASH:=no}

TIME_START=$(clock -monotonic)
EPOCH_START=$(clock -epoch)
Expand Down