This commit is contained in:
Mateusz Gruszczyński committed 2026-10-08 22:22:11 +02:00
1 parent f9b8c43f5f
commit 86aebcfc05
12 files changed
+177 -12

No files matched your search

+20 -2
View File
@@ -24,10 +24,27 @@ trap cleanup_opnsense_release EXIT
FREEBSD_BINARY="$OUT/rust-proxy-freebsd"
/opt/rust-package-builder/scripts/build-opnsense.sh "$SRC" "$FREEBSD_BINARY" "$BINARY_NAME" "$WORK"
if [[ "$SOURCE_REVISION" == "0" ]]; then
# PKG needs an increasing version for a packaging-only change at the same
# application commit, otherwise pkg upgrade would not install the new payload.
OPNSENSE_PACKAGE_REVISION=$SOURCE_REVISION
LAST_OPNSENSE_PACKAGE_VERSION=""
if [[ -r "$DATA_DIR/state/last_opnsense_package_version" ]]; then
LAST_OPNSENSE_PACKAGE_VERSION=$(cat "$DATA_DIR/state/last_opnsense_package_version")
elif [[ -r "$REPOSITORY/current/opnsense/BUILD-INFO.txt" ]]; then
LAST_OPNSENSE_PACKAGE_VERSION=$(sed -n 's/^package_version=//p' "$REPOSITORY/current/opnsense/BUILD-INFO.txt" | head -n1)
fi
if [[ "$LAST_OPNSENSE_PACKAGE_VERSION" == "${VERSION}_"* ]]; then
LAST_OPNSENSE_REVISION=${LAST_OPNSENSE_PACKAGE_VERSION#"${VERSION}_"}
if [[ "$LAST_OPNSENSE_REVISION" =~ ^[0-9]+$ ]] && (( LAST_OPNSENSE_REVISION >= OPNSENSE_PACKAGE_REVISION )); then
OPNSENSE_PACKAGE_REVISION=$((LAST_OPNSENSE_REVISION + 1))
fi
elif [[ "$LAST_OPNSENSE_PACKAGE_VERSION" == "$VERSION" && "$OPNSENSE_PACKAGE_REVISION" == "0" ]]; then
OPNSENSE_PACKAGE_REVISION=1
fi
if [[ "$OPNSENSE_PACKAGE_REVISION" == "0" ]]; then
OPNSENSE_PACKAGE_VERSION="$VERSION"
else
OPNSENSE_PACKAGE_VERSION="${VERSION}_${SOURCE_REVISION}"
OPNSENSE_PACKAGE_VERSION="${VERSION}_${OPNSENSE_PACKAGE_REVISION}"
fi
OPNSENSE_PACKAGE_FILE="$OUT/os-rustproxy-${OPNSENSE_PACKAGE_VERSION}.pkg"
/opt/rust-package-builder/scripts/package-opnsense.sh \
@@ -83,6 +100,7 @@ source_ref=$SOURCE_BRANCH
source_commit=$SHA
build_reason=$BUILD_REASON
source_revision=$SOURCE_REVISION
packaging_revision=$PACKAGING_REVISION
opnsense_series=$OPNSENSE_ABI
freebsd_release=$FREEBSD_RELEASE
freebsd_abi=$FREEBSD_ABI