git: b064317fa8de - main - release/pkg-stage: Support non-release artifact builds
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 08 May 2025 16:46:33 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=b064317fa8deb46d5b63bb52375f349fc4d7d5f5
commit b064317fa8deb46d5b63bb52375f349fc4d7d5f5
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-05-05 19:26:01 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-05-08 16:46:24 +0000
release/pkg-stage: Support non-release artifact builds
Add -N flag to invoke pkg commands with INSTALL_AS_USER mode, and
add package repo contents to METALOG.
Reviewed by: bapt, brooks
PR: 283387
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50173
---
release/scripts/pkg-stage.sh | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh
index fc74f8e6c0c6..ba6edf2eee07 100755
--- a/release/scripts/pkg-stage.sh
+++ b/release/scripts/pkg-stage.sh
@@ -4,12 +4,13 @@
set -e
+unset NO_ROOT
+
export ASSUME_ALWAYS_YES="YES"
export PKG_DBDIR="/tmp/pkg"
export PERMISSIVE="YES"
export REPO_AUTOUPDATE="NO"
export ROOTDIR="$PWD/dvd"
-export PKGCMD="/usr/sbin/pkg -d --rootdir ${ROOTDIR}"
export PORTSDIR="${PORTSDIR:-/usr/ports}"
_DVD_PACKAGES="
@@ -45,6 +46,25 @@ if [ ! -f ${PORTSDIR}/Makefile ]; then
exit 0
fi
+usage()
+{
+ echo "usage: $0 [-N]"
+ exit 0
+}
+
+while getopts N opt; do
+ case "$opt" in
+ N) NO_ROOT=1 ;;
+ *) usage ;;
+ esac
+done
+
+PKG_ARGS="-d --rootdir ${ROOTDIR}"
+if [ $NO_ROOT ]; then
+ PKG_ARGS="$PKG_ARGS -o INSTALL_AS_USER=1"
+fi
+PKGCMD="/usr/sbin/pkg ${PKG_ARGS}"
+
if [ ! -x /usr/local/sbin/pkg ]; then
/etc/rc.d/ldconfig restart
/usr/bin/make -C ${PORTSDIR}/ports-mgmt/pkg install clean
@@ -91,5 +111,10 @@ ln -s ../All/$(${PKGCMD} rquery %n-%v pkg).pkg ${LATEST_DIR}/pkg.pkg
${PKGCMD} repo ${PKG_REPODIR}
+if [ $NO_ROOT ]; then
+ mtree -c -p $ROOTDIR | mtree -C -k type,mode,link,size | \
+ grep '^./packages/' >> $ROOTDIR/METALOG
+fi
+
# Always exit '0', even if pkg(8) complains about conflicts.
exit 0