-
Notifications
You must be signed in to change notification settings - Fork 164
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 support for hashed mode to Poudriere #751
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6473,6 +6473,10 @@ delete_old_pkg() { | |
if [ -L "${pkg}" ]; then | ||
is_sym=1 | ||
fi | ||
if [ -d "${pkg}" ] && [ "${pkgfile}" = "Hashed" ]; then | ||
msg_debug "Ignoring directory" | ||
return 0; | ||
fi | ||
if [ "${is_sym}" -eq 1 ] && [ ! -e "${pkg}" ]; then | ||
msg "Deleting ${COLOR_PORT}${pkgfile}${COLOR_RESET}: dead symlink" | ||
delete_pkg "${pkg}" | ||
|
@@ -9468,12 +9472,16 @@ clean_restricted() { | |
} | ||
|
||
build_repo() { | ||
local origin pkg_repo_list_files | ||
local origin pkg_repo_list_files hashcmd | ||
|
||
msg "Creating pkg repository" | ||
if [ ${DRY_RUN} -eq 1 ]; then | ||
return 0 | ||
fi | ||
if [ ${PKG_HASH} != "no" ]; then | ||
hashcmd="--hash --symlink" | ||
PKG_REPO_FLAGS="${PKG_REPO_FLAGS:+${PKG_REPO_FLAGS} }$hashcmd" | ||
fi | ||
bset status "pkgrepo:" | ||
ensure_pkg_installed force_extract || \ | ||
err 1 "Unable to extract pkg." | ||
|
@@ -9493,12 +9501,20 @@ build_repo() { | |
install -m 0400 "${PKG_REPO_META_FILE}" \ | ||
"${MASTERMNT:?}/tmp/pkgmeta" | ||
fi | ||
|
||
# Remount rw | ||
# mount_nullfs does not support mount -u | ||
umount ${UMOUNT_NONBUSY} ${MASTERMNT}/packages || \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See 43cca93 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I think you can just use |
||
umount -f ${MASTERMNT}/packages | ||
mount_packages | ||
|
||
mkdir -p ${MASTERMNT}/tmp/packages | ||
if [ -n "${PKG_REPO_SIGNING_KEY}" ]; then | ||
msg "Signing repository with key: ${PKG_REPO_SIGNING_KEY}" | ||
install -m 0400 "${PKG_REPO_SIGNING_KEY}" \ | ||
"${MASTERMNT:?}/tmp/repo.key" | ||
injail ${PKG_BIN:?} repo \ | ||
${PKG_REPO_FLAGS} \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A goal I have is for |
||
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \ | ||
-o /tmp/packages \ | ||
${PKG_META} \ | ||
|
@@ -9515,6 +9531,7 @@ build_repo() { | |
# using SSH with DNSSEC as older hosts don't support | ||
# it. | ||
${MASTERMNT:?}${PKG_BIN:?} repo \ | ||
${PKG_REPO_FLAGS} \ | ||
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \ | ||
-o "${MASTERMNT:?}/tmp/packages" ${PKG_META_MASTERMNT} \ | ||
"${MASTERMNT:?}/packages" \ | ||
|
@@ -9527,6 +9544,7 @@ build_repo() { | |
;; | ||
esac | ||
JNETNAME="n" injail ${PKG_BIN:?} repo \ | ||
${PKG_REPO_FLAGS} \ | ||
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \ | ||
-o /tmp/packages ${PKG_META} /packages \ | ||
${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} || | ||
|
@@ -9542,6 +9560,11 @@ build_repo() { | |
sign_pkg pubkey "${PACKAGES:?}/Latest/pkg.${PKG_EXT}" | ||
fi | ||
fi | ||
|
||
# Remount ro | ||
umount ${UMOUNT_NONBUSY} ${MASTERMNT}/packages || \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UMOUNT_NONBUSY to -n here too. Or better |
||
umount -f ${MASTERMNT}/packages | ||
mount_packages -o ro | ||
} | ||
|
||
calculate_size_in_mb() { | ||
|
@@ -10109,6 +10132,7 @@ esac | |
: ${FLAVOR_DEFAULT_ALL:=no} | ||
: ${NULLFS_PATHS:="/rescue /usr/share /usr/tests /usr/lib32"} | ||
: ${PACKAGE_FETCH_URL:="pkg+http://pkg.FreeBSD.org/\${ABI}"} | ||
: ${PKG_HASH:=no} | ||
|
||
: ${POUDRIERE_TMPDIR:=$(command mktemp -dt poudriere)} | ||
: ${SHASH_VAR_PATH_DEFAULT:=${POUDRIERE_TMPDIR}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,6 +400,10 @@ delete_pkg() { | |
local pkg="$1" | ||
|
||
clear_pkg_cache "${pkg}" | ||
|
||
# If ${pkg} is a symlink, delete the target as well | ||
[ -L "${pkg}" ] && unlink $(realpath "${pkg}") | ||
|
||
# Delete the package and the depsfile since this package is being deleted, | ||
# which will force it to be recreated | ||
unlink "${pkg}" | ||
|
@@ -417,6 +421,8 @@ delete_pkg_xargs() { | |
# Delete the package and the depsfile since this package is being deleted, | ||
# which will force it to be recreated | ||
{ | ||
# If ${pkg} is a symlink, delete the target as well | ||
[ -L "${pkg}" ] && echo $(realpath "${pkg}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please avoid
|
||
echo "${pkg}" | ||
echo "${pkg_cache_dir}" | ||
} >> "${listfile}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to more recent given the PR idle time.