build: support pkg 1.17

This commit is contained in:
Franco Fichtner 2022-04-29 09:31:43 +02:00
parent 8ddbaaab99
commit 8ab4d23004
5 changed files with 17 additions and 18 deletions

View File

@ -799,13 +799,13 @@ search_packages()
# check whether the package has already been built
PKGFILE=${BASEDIR}${PACKAGESDIR}/All/${PKGNAME}-${PKGVERS}.pkg
if [ -f ${PKGFILE%%.pkg}.txz ]; then
if [ -f ${PKGFILE} ]; then
return 0
fi
# check whether the package is available
# under a different version number
PKGLINK=${BASEDIR}${PACKAGESDIR}/Latest/${PKGNAME}.txz
PKGLINK=${BASEDIR}${PACKAGESDIR}/Latest/${PKGNAME}.pkg
if [ -L ${PKGLINK} ]; then
PKGFILE=$(readlink -f ${PKGLINK} || true)
if [ -f ${PKGFILE} ]; then
@ -827,7 +827,7 @@ remove_packages()
for PKG in ${PKGLIST}; do
for PKGFILE in $(cd ${BASEDIR}${PACKAGESDIR}; \
find All -name "${PKG}-[0-9]*.txz" -type f); do
find All -name "${PKG}-[0-9]*.pkg" -type f); do
rm ${BASEDIR}${PACKAGESDIR}/${PKGFILE}
done
done
@ -923,7 +923,7 @@ install_packages()
PKGFOUND=
for PKGFILE in $({
cd ${BASEDIR}
find .${PACKAGESDIR}/All -name ${PKG}-[0-9]*.txz
find .${PACKAGESDIR}/All -name ${PKG}-[0-9]*.pkg
}); do
pkg -c ${BASEDIR} add ${PKGFILE}
PKGFOUND=1
@ -952,7 +952,7 @@ EOF
(
cd ${1}${PACKAGESDIR}/Latest
ln -sfn ../All/${4}-${5}.txz ${4}.txz
ln -sfn ../All/${4}-${5}.pkg ${4}.pkg
)
if [ -n "${PRODUCT_REBUILD}" ]; then
@ -1012,13 +1012,13 @@ bundle_packages()
| grep ^Name | awk '{ print $3; }')
(
cd ${BASEDIR}${PACKAGESDIR}-new/Latest
ln -sfn ../${PKGFILE} ${PKGINFO}.txz
ln -sfn ../${PKGFILE} ${PKGINFO}.pkg
)
generate_signature \
${BASEDIR}${PACKAGESDIR}-new/Latest/${PKGINFO}.txz
${BASEDIR}${PACKAGESDIR}-new/Latest/${PKGINFO}.pkg
done
# generate index files
# generate index files (XXX ideally from a chroot)
pkg repo ${BASEDIR}${PACKAGESDIR}-new/ ${SIGNARGS}
echo ${SRCABI} > ${BASEDIR}${PACKAGESDIR}-new/.abi_hint

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2021 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2022 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -137,14 +137,14 @@ UNAME_r=\$(freebsd-version)
# check whether the package has already been built
PKGFILE=\$(make -C ${PORTSDIR}/\${PORT} -v PKGFILE \${MAKE_ARGS})
if [ -f \${PKGFILE%%.pkg}.txz ]; then
if [ -f \${PKGFILE} ]; then
continue
fi
# check whether the package is available
# under a different version number
PKGNAME=\$(basename \${PKGFILE})
PKGNAME=\${PKGNAME%%-[0-9]*}.txz
PKGNAME=\${PKGNAME%%-[0-9]*}.pkg
PKGLINK=${PACKAGESDIR}/Latest/\${PKGNAME}
if [ -L \${PKGLINK} ]; then
PKGFILE=\$(readlink -f \${PKGLINK} || true)
@ -198,12 +198,12 @@ UNAME_r=\$(freebsd-version)
pkg autoremove -y
for PKGNAME in \$(pkg query %n); do
OLD=\$(find ${PACKAGESDIR}/All -name "\${PKGNAME}-[0-9]*.txz")
OLD=\$(find ${PACKAGESDIR}/All -name "\${PKGNAME}-[0-9]*.pkg")
if [ -n "\${OLD}" ]; then
# already found
continue
fi
NEW=\$(find ${PACKAGESDIR}-cache/All -name "\${PKGNAME}-[0-9]*.txz")
NEW=\$(find ${PACKAGESDIR}-cache/All -name "\${PKGNAME}-[0-9]*.pkg")
echo ">>> Saving runtime package: \${PKGNAME}"
cp \${NEW} ${PACKAGESDIR}/All
done

View File

@ -34,14 +34,14 @@ if [ ! -f "${PACKAGESET}" ]; then
exit 1
fi
COREFILE=$(tar -tf ${PACKAGESET} | grep -x "\./All/${PRODUCT_CORE}-[0-9].*\.txz")
COREFILE=$(tar -tf ${PACKAGESET} | grep -x "\./All/${PRODUCT_CORE}-[0-9].*\.pkg")
if [ -z "${COREFILE}" ]; then
echo ">>> Cannot continue without core package: ${PRODUCT_CORE}"
exit 1
fi
COREFILE=$(basename ${COREFILE%%.txz})
COREFILE=$(basename ${COREFILE%%.pkg})
COREFILE=$(basename ${COREFILE%%_*})
make clean-obj,release,images release VERSION=${COREFILE##*-}

View File

@ -34,14 +34,14 @@ if [ ! -f "${PACKAGESET}" ]; then
exit 1
fi
COREFILE=$(tar -tf ${PACKAGESET} | grep -x "\./All/${PRODUCT_CORE}-[0-9].*\.txz")
COREFILE=$(tar -tf ${PACKAGESET} | grep -x "\./All/${PRODUCT_CORE}-[0-9].*\.pkg")
if [ -z "${COREFILE}" ]; then
echo ">>> Cannot continue without core package: ${PRODUCT_CORE}"
exit 1
fi
COREFILE=$(basename ${COREFILE%%.txz})
COREFILE=$(basename ${COREFILE%%.pkg})
FS=ufs
if [ -n "${PRODUCT_ZFS}" ]; then

View File

@ -44,7 +44,6 @@ ALLOW_UNSUPPORTED_SYSTEM=why not
WARNING_WAIT= 0 # no time
WRKDIRPREFIX= /usr/obj
PACKAGE_BUILDING= yes
PKG_COMPRESSION_FORMAT= txz # required for pkg 1.6.3
#DEVELOPER= yes
BATCH= yes