This commit is contained in:
Xavier Beaudouin
2025-02-05 15:36:39 +01:00
parent e2e1446597
commit 8cc1cef1fd
16 changed files with 0 additions and 815 deletions

View File

@ -1,70 +0,0 @@
PORTNAME= check_mk_agent
DISTVERSIONPREFIX= v
DISTVERSION= 2.3.0p12
PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= https://raw.githubusercontent.com/Checkmk/checkmk/${DISTVERSIONFULL}/agents/:agent \
https://raw.githubusercontent.com/Checkmk/checkmk/${DISTVERSIONFULL}/doc/agents/:doc \
https://raw.githubusercontent.com/Checkmk/checkmk/${DISTVERSIONFULL}/:license
DISTFILES= ${_CHECKMK_AGENT}:agent \
README.FreeBSD:doc \
COPYING:license
DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
MAINTAINER= ivalentine@arizona.edu
COMMENT= Checkmk agent to monitor *nix style systems
WWW= https://checkmk.com/
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= bash:shells/bash \
ipmitool:sysutils/ipmitool \
statgrab:devel/libstatgrab \
wget:ftp/wget
USES= perl5 python:3.4+ shebangfix
USE_PERL5= run
SHEBANG_FILES= ${_CHECKMK_AGENT}
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= # none
EXTRACT_AFTER_ARGS= ${WRKSRC}
NO_ARCH= yes
NO_BUILD= yes
NO_TEST= yes
SUB_FILES= pkg-message
SUB_LIST= PORTNAME=${PORTNAME}
NO_WRKSUBDIR= yes
PLIST_FILES= bin/${PORTNAME}
PORTDOCS= README.FreeBSD
OPTIONS_DEFINE= DOCS
_CHECKMK_AGENT= ${PORTNAME}.freebsd
_CHECKMK_LIBDIR= ${PREFIX}/lib/check_mk_agent
_CHECKMK_CONFDIR= ${PREFIX}/etc/check_mk
post-patch:
@${REINPLACE_CMD} \
-e 's|%%CHECKMK_LIBDIR%%|${_CHECKMK_LIBDIR}|' \
-e 's|%%CHECKMK_CONFDIR%%|${_CHECKMK_CONFDIR}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/${_CHECKMK_AGENT}
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/${_CHECKMK_AGENT} \
${STAGEDIR}${PREFIX}/bin/${PORTNAME}
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.FreeBSD \
${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -1,7 +0,0 @@
TIMESTAMP = 1723755628
SHA256 (check_mk_agent-2.3.0.p12/check_mk_agent.freebsd) = e90757599339de56cab8f5059a1006d20f6bdfe9cb5cfd8460b95deee8039ffd
SIZE (check_mk_agent-2.3.0.p12/check_mk_agent.freebsd) = 32404
SHA256 (check_mk_agent-2.3.0.p12/README.FreeBSD) = 01094a2197ca0a3a43ac16098c0f800d2ee808db2fd9a2f133f4bad04062ec5f
SIZE (check_mk_agent-2.3.0.p12/README.FreeBSD) = 1349
SHA256 (check_mk_agent-2.3.0.p12/COPYING) = fbaab079995bef694ef8451f0f763b91b44e5b57b8e2a487d2a240b395187a7f
SIZE (check_mk_agent-2.3.0.p12/COPYING) = 15174

View File

@ -1,35 +0,0 @@
--- check_mk_agent.freebsd.orig 2024-09-09 09:16:10 UTC
+++ check_mk_agent.freebsd
@@ -118,8 +118,8 @@ set_variable_defaults() {
set_variable_defaults() {
: "${MK_LIBDIR:=/usr/local/lib/check_mk_agent}"
- : "${MK_CONFDIR:=/etc/check_mk}"
- : "${MK_VARDIR:=/var/lib/check_mk_agent}"
+ : "${MK_CONFDIR:=/usr/local/etc/check_mk}"
+ : "${MK_VARDIR:=/var/db/check_mk_agent}"
: "${MK_LOGDIR:=/var/log/check_mk_agent}"
# some 'booleans'
@@ -597,6 +597,21 @@ run_purely_synchronous_sections() {
rm -f "${tmpfile}"
fi
+
+ echo '<<<sysctl_mem>>>'
+ _page_size=$( sysctl -n vm.stats.vm.v_page_size )
+ echo "mem.cache $(( _page_size * $( sysctl -n vm.stats.vm.v_cache_count ) ))"
+ echo "mem.free $(( _page_size * $( sysctl -n vm.stats.vm.v_free_count ) ))"
+ echo "mem.total $( sysctl -n hw.physmem )"
+ echo "mem.used $(( _page_size * ( $( sysctl -n vm.stats.vm.v_active_count ) + $( sysctl -n vm.stats.vm.v_wire_count ) ) ))"
+ _swap_total=$( sysctl -n vm.swap_total )
+ _swap_used=$(( $( swapinfo | tail -1 | awk '{print $3}' ) * 1024 ))
+ echo "swap.free $(( _swap_total - _swap_used ))"
+ echo "swap.total ${_swap_total}"
+ echo "swap.used ${_swap_used}"
+ unset -v _page_size
+ unset -v _swap_total
+ unset -v _swap_used
}
#

View File

@ -1,16 +0,0 @@
[
{ type: install
message: <<EOM
Checkmk may collect additional data if the following ports are installed:
- sysutils/megacli
- mail/postfix
- mail/qmail
See the code of the agent (%%PREFIX%%/bin/%%PORTNAME%%) for details.
Configuration instructions may be found in one of the following places:
- %%DOCSDIR%%/README.FreeBSD
- https://docs.checkmk.com/latest/en/agent_freebsd.html
EOM
}
]

View File

@ -1,16 +0,0 @@
For a monitoring system to receive more information from an endpoint
other than that it is simply accessible, help is required from the
target system. For example - how else can Checkmk know how full a
server's storage volume is without that system somehow providing the
information? The component that provides this information is always an
active piece of software - namely a monitoring agent, usually just
referred to as an agent. An agent collects data relevant to monitoring
from a host at specified intervals and transmits that data to the
monitoring server.
For servers and workstations, Checkmk provides its own agents, these
are known as Checkmk agents. Checkmk agents are available for a wide
variety of operating systems - from the commonplace such as Windows and
Linux to exotics such as OpenVMS. The agents are passive and listen on
TCP port 6556. Only on receiving a Checkmk server query will these
agents be activated and respond with the required data.

View File

@ -1,240 +0,0 @@
diff --git a/src/etc/poudriere.conf.sample b/src/etc/poudriere.conf.sample
index c0ba896d927ca1700cc78e57cb953deec43b5484..337eb1827904daba5bf5df5790d005f6e7fa3de9 100644
--- a/src/etc/poudriere.conf.sample
+++ b/src/etc/poudriere.conf.sample
@@ -383,3 +383,16 @@ DISTFILES_CACHE=/usr/ports/distfiles
# be fetched.
# Default: everything
#PACKAGE_FETCH_WHITELIST="gcc* rust llvm*"
+
+# Have pkg create the repo such that each package is named with the short hash
+# of its file contents in the package filename, with symlinks to the traditional
+# package filenames. The packagesite.yaml file will point to the hashed version
+# of these files. By using hashed pkg filenames, this allows users to lazily
+# cache packages without conflicting with the existing packages, or serving stale
+# packages from a cache. Once the packages are synced the much
+# smaller meta files can then be synced. Allowing a near atomic update of the repo.
+# On caching CDNs this means a need to purge 2-5 files instead of all pkgs that
+# have been updated.
+# The symlinks are only required for the local poudriere for resovling dependencies,
+# they do not need to be uploaded to the CDN.
+#PKG_HASH="no"
diff --git a/src/man/poudriere-bulk.8 b/src/man/poudriere-bulk.8
index 81cf698eeb6670048628d83e819fd84ad433be93..dac4eb3211a9fd0afe451779449693acade24430 100644
--- a/src/man/poudriere-bulk.8
+++ b/src/man/poudriere-bulk.8
@@ -28,7 +28,7 @@
.\"
.\" Note: The date here should be updated whenever a non-trivial
.\" change is made to the manual page.
-.Dd July 5, 2022
+.Dd September 26, 2022
.Dt POUDRIERE-BULK 8
.Os
.Sh NAME
@@ -38,7 +38,7 @@
.Nm
.Fl a
.Fl j Ar name
-.Op Fl CcFIikNnRrSTtvw
+.Op Fl CcFHIikNnRrSTtvw
.Op Fl B Ar name
.Op Fl b Ar branch
.Op Fl J Ar maxjobs Ns Op Cm \&: Ns Ar prebuildmaxjobs
@@ -48,7 +48,7 @@
.Nm
.Fl f Ar file Op Fl f Ar file2 Ar ...
.Fl j Ar name
-.Op Fl CcFIikNnRrSTtvw
+.Op Fl CcFHIikNnRrSTtvw
.Op Fl B Ar name
.Op Fl b Ar branch
.Op Fl J Ar maxjobs Ns Op Cm \&: Ns Ar prebuildmaxjobs
@@ -57,7 +57,7 @@
.Op Fl z Ar set
.Nm
.Fl j Ar name
-.Op Fl CcFIikNnRrSTtvw
+.Op Fl CcFHIikNnRrSTtvw
.Op Fl B Ar name
.Op Fl b Ar branch
.Op Fl J Ar maxjobs Ns Op Cm \&: Ns Ar prebuildmaxjobs
@@ -232,6 +232,8 @@ Fetch only from the original
Skip
.Fx
mirrors.
+.It Fl H
+Create a repository where the package filenames contain the short hash of the contents.
.It Fl I
Advanced interactive mode.
.Pp
diff --git a/src/share/poudriere/bulk.sh b/src/share/poudriere/bulk.sh
index 3507ceb3548910c8aa688148614f1eadf72dd695..126b3becc6d050ede819bddebc0ae55b6712aaba 100755
--- a/src/share/poudriere/bulk.sh
+++ b/src/share/poudriere/bulk.sh
@@ -47,6 +47,8 @@ Options:
-f file. Implies -c for -a.
-c -- Clean all the previously built binary packages and logs.
-F -- Only fetch from original master_site (skip FreeBSD mirrors)
+ -H -- Create a repository where the package filenames contain the
+ short hash of the contents.
-I -- Advanced Interactive mode. Leaves jail running with ports
installed after test.
-i -- Interactive mode. Enter jail for interactive testing and
@@ -97,7 +99,7 @@ if [ $# -eq 0 ]; then
usage
fi
-while getopts "ab:B:CcFf:iIj:J:knNO:p:RrSTtvwz:" FLAG; do
+while getopts "ab:B:CcFf:HiIj:J:knNO:p:RrSTtvwz:" FLAG; do
case "${FLAG}" in
a)
ALL=1
@@ -126,6 +128,9 @@ while getopts "ab:B:CcFf:iIj:J:knNO:p:RrSTtvwz:" FLAG; do
fi
LISTPKGS="${LISTPKGS:+${LISTPKGS} }${OPTARG}"
;;
+ H)
+ PKG_REPO_FLAGS="${PKG_REPO_FLAGS:+${PKG_REPO_FLAGS} }--hash --symlink"
+ ;;
I)
INTERACTIVE_MODE=2
;;
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index a4907362c76000bc81fb8b7dbd61918fb7426538..e52cfb432e15783e9d3b47a018d8d1735a70a5cf 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -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 || \
+ 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} \
${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 || \
+ 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}}
diff --git a/src/share/poudriere/include/pkg.sh b/src/share/poudriere/include/pkg.sh
index d4821400cb2ad20a6994a5d9145604f8081a98f6..360518520d6f1067531380ea9040ec2d1d4c1f33 100644
--- a/src/share/poudriere/include/pkg.sh
+++ b/src/share/poudriere/include/pkg.sh
@@ -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}")
echo "${pkg}"
echo "${pkg_cache_dir}"
} >> "${listfile}"
diff --git a/src/share/poudriere/pkgclean.sh b/src/share/poudriere/pkgclean.sh
old mode 100755
new mode 100644
index fafc3c0a547335ddee32033bf9d0700ccf556fca..5458d3d04dd2e05727c1c79ce0ba0d73d3946665
--- a/src/share/poudriere/pkgclean.sh
+++ b/src/share/poudriere/pkgclean.sh
@@ -289,6 +289,8 @@ check_should_delete_pkg() {
*".${PKG_EXT}")
if should_delete "${file}"; then
echo "${file}" >> "${BADFILES_LIST:?}"
+ # If the pkg is a symlink to a hashed package, remove the hashed version as well
+ [ -L "${file}" ] && echo "$(realpath ${file})" >> ${BADFILES_LIST}
fi
;;
*.txz)
@@ -305,6 +307,8 @@ check_should_delete_pkg() {
*)
msg_verbose "Found incorrect format file: ${file}"
echo "${file}" >> "${BADFILES_LIST:?}"
+ # If the pkg is a symlink to a hashed package, remove the hashed version as well
+ [ -L "${file}" ] && echo "$(realpath ${file})" >> ${BADFILES_LIST}
;;
esac
}

View File

@ -1,93 +0,0 @@
PORTNAME= poudriere
DISTVERSION= 3.4.99.20240826
PORTREVISION= 0
CATEGORIES= ports-mgmt
MASTER_SITES= LOCAL/bdrewery/${PORTNAME}/ \
http://mirror.shatow.net/freebsd/${PORTNAME}/ \
GH
PKGNAMESUFFIX= -devel
MAINTAINER= bdrewery@FreeBSD.org
COMMENT= Port build and test system
WWW= https://github.com/freebsd/poudriere/wiki
LICENSE= BSD2CLAUSE
CONFLICTS_INSTALL= poudriere
USE_GITHUB= yes
GH_ACCOUNT= freebsd
GH_TAGNAME= 3.3.0-1769-gbac754676d
GNU_CONFIGURE= yes
ETCDIR= ${PREFIX}/etc/poudriere.d
OPTIONS_DEFINE= BASH MANIFESTS PORTCONFIG EXAMPLES QEMU ZSH
OPTIONS_DEFAULT=BASH MANIFESTS PORTCONFIG ZSH
OPTIONS_SUB= yes
MANIFESTS_DESC= Install manifests for jail creation
MANIFESTS_RUN_DEPENDS+= freebsd-release-manifests>0:misc/freebsd-release-manifests
PORTCONFIG_DESC= Install portconfig for options command
PORTCONFIG_RUN_DEPENDS= portconfig>0:ports-mgmt/portconfig
QEMU_DESC= Add qemu-user-static for non-x86 architectures
QEMU_RUN_DEPENDS= qemu-user-static>0:emulators/qemu-user-static
# gmake is not strictly needed but handles test jobs better
TEST_DEPENDS= gmake>0:devel/gmake
TEST_ENV= MAKE=gmake
.if make(test)
MAKE_CMD= gmake
.endif
TEST_TARGET= check
TEST_ARGS= -s
TEST_ARGS+= ${_MAKE_JOBS}
# ccache passthrough helps for building pkg a few hundred times.
# ccache not added as a dependency because it is only used if setup
# and provided in the env already.
# XXX: Passthrough local PKGREPOSITORY dir for fetch support
ccache_vars= CCACHE_DIR_NON_ROOT_SAFE CCACHE_GROUP \
CCACHE_GID CCACHE_STATIC_PREFIX CCACHE_TEMPDIR \
CCACHE_DIR CCACHE_NLEVELS
.for _cv in ${ccache_vars}
. if !empty(${_cv})
TEST_ENV+= ${_cv}=${${_cv}}
. endif
.endfor
.include <bsd.port.options.mk>
# rm -x support came in 10.0. A bundled rm is used if not supported in base.
# While <10 is technically not supported in the Ports Tree, Poudriere
# detects this and it being a package build tool it should still be
# supported as a user may be installing this to build packages for upgrading
# their system to a supported release.
.if ${OSVERSION} < 1000000
PLIST_SUB+= RM=""
.else
PLIST_SUB+= RM="@comment "
.endif
post-patch:
${REINPLACE_CMD} \
-e "s,^\(POUDRIERE_VERSION\)=.*,\1='${PKGVERSION}'," \
${WRKSRC}/src/bin/poudriere.in
post-install:
${LN} -fs ${LOCALBASE}/share/freebsd/MANIFESTS \
${STAGEDIR}${DATADIR}/MANIFESTS
post-install-BASH-on:
@${MKDIR} ${STAGEDIR}${PREFIX}/share/bash-completion/completions/
${INSTALL_DATA} ${WRKSRC}/completions/bash/poudriere \
${STAGEDIR}${PREFIX}/share/bash-completion/completions/
post-install-ZSH-on:
@${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions/
${INSTALL_DATA} ${WRKSRC}/completions/zsh/_poudriere \
${STAGEDIR}${PREFIX}/share/zsh/site-functions/
.include <bsd.port.mk>

View File

@ -1,3 +0,0 @@
TIMESTAMP = 1724665577
SHA256 (freebsd-poudriere-3.4.99.20240826-3.3.0-1769-gbac754676d_GH0.tar.gz) = 57f602eb6de964fa131992879971799bf1192d9bc9ccf0a37bd7925368993f48
SIZE (freebsd-poudriere-3.4.99.20240826-3.3.0-1769-gbac754676d_GH0.tar.gz) = 5744773

View File

@ -1,19 +0,0 @@
--- src/etc/poudriere.conf.sample.orig 2024-08-11 06:43:13 UTC
+++ src/etc/poudriere.conf.sample
@@ -385,3 +385,16 @@ DISTFILES_CACHE=/usr/ports/distfiles
# be fetched.
# Default: everything
#PACKAGE_FETCH_WHITELIST="gcc* rust llvm*"
+
+# Have pkg create the repo such that each package is named with the short hash
+# of its file contents in the package filename, with symlinks to the traditional
+# package filenames. The packagesite.yaml file will point to the hashed version
+# of these files. By using hashed pkg filenames, this allows users to lazily
+# cache packages without conflicting with the existing packages, or serving stale
+# packages from a cache. Once the packages are synced the much
+# smaller meta files can then be synced. Allowing a near atomic update of the repo.
+# On caching CDNs this means a need to purge 2-5 files instead of all pkgs that
+# have been updated.
+# The symlinks are only required for the local poudriere for resovling dependencies,
+# they do not need to be uploaded to the CDN.
+#PKG_HASH="no"

View File

@ -1,38 +0,0 @@
--- src/man/poudriere-bulk.8.orig 2024-08-11 06:43:13 UTC
+++ src/man/poudriere-bulk.8
@@ -38,7 +38,7 @@
.Nm
.Fl a
.Fl j Ar name
-.Op Fl CcFIikNnRrSTtvw
+.Op Fl CcFHIikNnRrSTtvw
.Op Fl B Ar name
.Op Fl b Ar branch
.Op Fl J Ar maxjobs Ns Op Cm \&: Ns Ar prebuildmaxjobs
@@ -48,7 +48,7 @@
.Nm
.Fl f Ar file Op Fl f Ar file2 Ar ...
.Fl j Ar name
-.Op Fl CcFIikNnRrSTtvw
+.Op Fl CcFHIikNnRrSTtvw
.Op Fl B Ar name
.Op Fl b Ar branch
.Op Fl J Ar maxjobs Ns Op Cm \&: Ns Ar prebuildmaxjobs
@@ -57,7 +57,7 @@
.Op Fl z Ar set
.Nm
.Fl j Ar name
-.Op Fl CcFIikNnRrSTtvw
+.Op Fl CcFHIikNnRrSTtvw
.Op Fl B Ar name
.Op Fl b Ar branch
.Op Fl J Ar maxjobs Ns Op Cm \&: Ns Ar prebuildmaxjobs
@@ -232,6 +232,8 @@ mirrors.
Skip
.Fx
mirrors.
+.It Fl H
+Create a repository where the package filenames contain the short hash of the contents.
.It Fl I
Advanced interactive mode.
.Pp

View File

@ -1,30 +0,0 @@
--- src/share/poudriere/bulk.sh.orig 2024-08-11 06:43:13 UTC
+++ src/share/poudriere/bulk.sh
@@ -47,6 +47,8 @@ Options:
-f file. Implies -c for -a.
-c -- Clean all the previously built binary packages and logs.
-F -- Only fetch from original master_site (skip FreeBSD mirrors)
+ -H -- Create a repository where the package filenames contain the
+ short hash of the contents.
-I -- Advanced Interactive mode. Leaves jail running with ports
installed after test.
-i -- Interactive mode. Enter jail for interactive testing and
@@ -101,7 +103,7 @@ fi
usage
fi
-while getopts "ab:B:CcFf:iIj:J:knNO:p:RrSTtvwz:" FLAG; do
+while getopts "ab:B:CcFf:HiIj:J:knNO:p:RrSTtvwz:" FLAG; do
case "${FLAG}" in
a)
ALL=1
@@ -129,6 +131,9 @@ while getopts "ab:B:CcFf:iIj:J:knNO:p:RrSTtvwz:" FLAG;
OPTARG="${SAVED_PWD}/${OPTARG}"
fi
LISTPKGS="${LISTPKGS:+${LISTPKGS} }${OPTARG}"
+ ;;
+ H)
+ PKG_REPO_FLAGS="${PKG_REPO_FLAGS:+${PKG_REPO_FLAGS} }--hash --symlink"
;;
I)
INTERACTIVE_MODE=2

View File

@ -1,88 +0,0 @@
--- src/share/poudriere/common.sh.orig 2024-08-11 06:43:13 UTC
+++ src/share/poudriere/common.sh
@@ -6626,6 +6626,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}"
@@ -9835,12 +9839,16 @@ build_repo() {
}
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."
@@ -9860,12 +9868,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 || \
+ 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} \
${pkg_repo_list_files:+"${pkg_repo_list_files}"} \
-o /tmp/packages \
${PKG_META} \
@@ -9882,6 +9898,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" \
@@ -9894,6 +9911,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}} ||
@@ -9909,6 +9927,11 @@ build_repo() {
sign_pkg pubkey "${PACKAGES:?}/Latest/pkg.${PKG_EXT}"
fi
fi
+
+ # Remount ro
+ umount ${UMOUNT_NONBUSY} ${MASTERMNT}/packages || \
+ umount -f ${MASTERMNT}/packages
+ mount_packages -o ro
}
calculate_size_in_mb() {
@@ -10477,6 +10500,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}}

View File

@ -1,22 +0,0 @@
--- src/share/poudriere/include/pkg.sh.orig 2024-08-11 06:43:13 UTC
+++ src/share/poudriere/include/pkg.sh
@@ -466,6 +466,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}"
@@ -483,6 +487,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}")
echo "${pkg}"
echo "${pkg_cache_dir}"
} >> "${listfile}"

View File

@ -1,20 +0,0 @@
--- src/share/poudriere/pkgclean.sh.orig 2024-08-11 06:43:13 UTC
+++ src/share/poudriere/pkgclean.sh
@@ -289,6 +289,8 @@ check_should_delete_pkg() {
*".${PKG_EXT}")
if should_delete "${file}"; then
echo "${file}" >> "${BADFILES_LIST:?}"
+ # If the pkg is a symlink to a hashed package, remove the hashed version as well
+ [ -L "${file}" ] && echo "$(realpath ${file})" >> ${BADFILES_LIST}
fi
;;
*.txz)
@@ -305,6 +307,8 @@ check_should_delete_pkg() {
*)
msg_verbose "Found incorrect format file: ${file}"
echo "${file}" >> "${BADFILES_LIST:?}"
+ # If the pkg is a symlink to a hashed package, remove the hashed version as well
+ [ -L "${file}" ] && echo "$(realpath ${file})" >> ${BADFILES_LIST}
;;
esac
}

View File

@ -1,3 +0,0 @@
poudriere is a tool primarily designed to test package production on
FreeBSD. However, most people will find it useful to bulk build ports
for FreeBSD.

View File

@ -1,115 +0,0 @@
bin/poudriere
@sample etc/poudriere.conf.sample
%%ETCDIR%%/hooks/bulk.sh.sample
%%ETCDIR%%/hooks/pkgbuild.sh.sample
@sample(0,0,0) etc/poudriered.conf.sample
etc/rc.d/poudriered
@comment libexec/poudriere/cachec
libexec/poudriere/clock
libexec/poudriere/cpdup
libexec/poudriere/dirempty
libexec/poudriere/dirwatch
libexec/poudriere/locked_mkdir
libexec/poudriere/nc
libexec/poudriere/poudriered
libexec/poudriere/ptsort
libexec/poudriere/pwait
libexec/poudriere/rename
%%RM%%libexec/poudriere/rm
libexec/poudriere/setsid
libexec/poudriere/sh
libexec/poudriere/timeout
libexec/poudriere/timestamp
%%BASH%%share/bash-completion/completions/poudriere
share/man/man8/poudriere-bulk.8.gz
share/man/man8/poudriere-distclean.8.gz
share/man/man8/poudriere-image.8.gz
share/man/man8/poudriere-jail.8.gz
share/man/man8/poudriere-logclean.8.gz
share/man/man8/poudriere-options.8.gz
share/man/man8/poudriere-pkgclean.8.gz
share/man/man8/poudriere-ports.8.gz
share/man/man8/poudriere-queue.8.gz
share/man/man8/poudriere-status.8.gz
share/man/man8/poudriere-testport.8.gz
share/man/man8/poudriere-version.8.gz
share/man/man8/poudriere.8.gz
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Caddyfile.sample
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/httpd.conf.sample
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/nginx.conf.sample
%%DATADIR%%/MANIFESTS
%%DATADIR%%/api.sh
%%DATADIR%%/awk/dependency_loop.awk
%%DATADIR%%/awk/file_cmp_reg.awk
%%DATADIR%%/awk/humanize.awk
%%DATADIR%%/awk/json.awk
%%DATADIR%%/awk/json_jail.awk
%%DATADIR%%/awk/json_top.awk
%%DATADIR%%/awk/parse_MOVED.awk
%%DATADIR%%/awk/processonelog.awk
%%DATADIR%%/awk/processonelog2.awk
%%DATADIR%%/awk/siginfo_buildtime.awk
%%DATADIR%%/awk/unique_pkgnames_from_flavored_origins.awk
%%DATADIR%%/bulk.sh
%%DATADIR%%/common.sh
%%DATADIR%%/daemon.sh
%%DATADIR%%/distclean.sh
%%DATADIR%%/foreachport.sh
%%DATADIR%%/html/assets/DataTables-1.13.8/css/dataTables.bootstrap5.min.css
%%DATADIR%%/html/assets/DataTables-1.13.8/images/sort_asc.png
%%DATADIR%%/html/assets/DataTables-1.13.8/images/sort_asc_disabled.png
%%DATADIR%%/html/assets/DataTables-1.13.8/images/sort_both.png
%%DATADIR%%/html/assets/DataTables-1.13.8/images/sort_desc.png
%%DATADIR%%/html/assets/DataTables-1.13.8/images/sort_desc_disabled.png
%%DATADIR%%/html/assets/DataTables-1.13.8/js/dataTables.bootstrap5.min.js
%%DATADIR%%/html/assets/DataTables-1.13.8/js/jquery.dataTables.min.js
%%DATADIR%%/html/assets/bootstrap-5.3.2/css/bootstrap.min.css
%%DATADIR%%/html/assets/bootstrap-5.3.2/js/bootstrap.bundle.min.js
%%DATADIR%%/html/assets/favicon.png
%%DATADIR%%/html/assets/jquery-3.7.1/jquery-3.7.1.js
%%DATADIR%%/html/assets/jquery-3.7.1/jquery-3.7.1.min.js
%%DATADIR%%/html/assets/jquery-3.7.1/jquery-3.7.1.min.map
%%DATADIR%%/html/assets/jquery.dataTables.rowGrouping-1.2.9.js
%%DATADIR%%/html/assets/logo-dark.png
%%DATADIR%%/html/assets/logo-light.png
%%DATADIR%%/html/assets/poudriere.js
%%DATADIR%%/html/build.html
%%DATADIR%%/html/index.html
%%DATADIR%%/html/jail.html
%%DATADIR%%/html/robots.txt
%%DATADIR%%/image.sh
%%DATADIR%%/image_dump.sh
%%DATADIR%%/image_firmware.sh
%%DATADIR%%/image_hybridiso.sh
%%DATADIR%%/image_iso.sh
%%DATADIR%%/image_mfs.sh
%%DATADIR%%/image_rawdisk.sh
%%DATADIR%%/image_tar.sh
%%DATADIR%%/image_usb.sh
%%DATADIR%%/image_zfs.sh
%%DATADIR%%/image_zsnapshot.sh
%%DATADIR%%/include/asserts.sh
%%DATADIR%%/include/cache.sh
%%DATADIR%%/include/colors.pre.sh
%%DATADIR%%/include/colors.sh
%%DATADIR%%/include/common.sh.dragonfly
%%DATADIR%%/include/common.sh.freebsd
%%DATADIR%%/include/display.sh
%%DATADIR%%/include/fs.sh
%%DATADIR%%/include/hash.sh
%%DATADIR%%/include/html.sh
%%DATADIR%%/include/parallel.sh
%%DATADIR%%/include/pkg.sh
%%DATADIR%%/include/pkgqueue.sh
%%DATADIR%%/include/shared_hash.sh
%%DATADIR%%/include/util.sh
%%DATADIR%%/jail.sh
%%DATADIR%%/logclean.sh
%%DATADIR%%/options.sh
%%DATADIR%%/pkgclean.sh
%%DATADIR%%/ports.sh
%%DATADIR%%/processonelog.sh
%%DATADIR%%/queue.sh
%%DATADIR%%/status.sh
%%DATADIR%%/testport.sh
%%ZSH%%share/zsh/site-functions/_poudriere