Skip to content

Commit

Permalink
Add new pkg repo file hash ability to poudriere.conf Default to off
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfiberiru committed Sep 14, 2020
1 parent 1cc9856 commit 35eb77f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/etc/poudriere.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,9 @@ 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. This is usefaully in a cdn enviroment to ensure pkg names are
# unique and to avoid cdn sync issues
#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
PKG_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

0 comments on commit 35eb77f

Please sign in to comment.