From 3e78d520ae003ea998883e7dc43a93ea4aee4799 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Thu, 29 Oct 2026 21:42:15 +0100 Subject: [PATCH] update: the package is published for Ubuntu 26.04 (resolute) as well as 24.04 (noble). --- README.md | 4 +++- debian-package/debian/changelog | 11 +++++++++++ debian-package/publish.sh | 25 +++++++++++++++---------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7783e74..0591ab8 100644 --- a/README.md +++ b/README.md @@ -1919,4 +1919,6 @@ cd debian-package ``` The build runs in a container and writes the package to `debian-package/out/`. -`./publish.sh` uploads it to the configured repository. +`./publish.sh` uploads it to the component `main` of the distributions `noble` and `resolute` of +the configured repository, skipping a distribution that has the version already; +`DISTRIBUTIONS` names others. diff --git a/debian-package/debian/changelog b/debian-package/debian/changelog index 2b8154e..2e612a1 100644 --- a/debian-package/debian/changelog +++ b/debian-package/debian/changelog @@ -1,3 +1,14 @@ +vpn-router (0.35.2-2) unstable; urgency=medium + + update: the package is published for Ubuntu 26.04 (resolute) as well as 24.04 (noble). + + * publish.sh uploads the package to the distributions noble and resolute + of the repository, component main, skipping a distribution that has + the version already; DISTRIBUTIONS names others. A router on Ubuntu + 26.04 installs vpn-router from the distribution resolute. + + -- Slawomir Koszewski Thu, 29 Oct 2026 21:41:32 +0100 + vpn-router (0.35.2-1) unstable; urgency=medium fix: the web service answers /, /status and /status/full again while IKEv2 runs. diff --git a/debian-package/publish.sh b/debian-package/publish.sh index f31f7ce..ee76222 100755 --- a/debian-package/publish.sh +++ b/debian-package/publish.sh @@ -11,6 +11,8 @@ esac OWNER="${OWNER:-slawek}" SERVER_URL="${SERVER_URL:-https://gitea.koszewscy.waw.pl}" PACKAGES_TOKEN="${PACKAGES_TOKEN:-$(cat ~/.gitea-packages-token)}" +# The Ubuntu releases whose distribution of the repository gets the package, in its component main. +DISTRIBUTIONS="${DISTRIBUTIONS:-noble resolute}" # Reads the changelog copied into the builder image, so no bind mount is needed. changelog_field() { @@ -27,14 +29,17 @@ if [ ! -f "$DEB" ]; then exit 1 fi -STATUS="$(curl -s -o /dev/null -w '%{http_code}' --user "$OWNER:$PACKAGES_TOKEN" \ - "$SERVER_URL/api/v1/packages/$OWNER/debian/$PACKAGE/$VERSION")" -case "$STATUS" in - 200) printf '%s %s is already published, skipping.\n' "$PACKAGE" "$VERSION"; exit 0 ;; - 404) ;; - *) printf 'ERROR: version check returned HTTP %s.\n' "$STATUS" >&2; exit 1 ;; -esac +BODY="$(mktemp)" +trap 'rm -f "$BODY"' EXIT -curl --fail-with-body --user "$OWNER:$PACKAGES_TOKEN" \ - --upload-file "$DEB" \ - "$SERVER_URL/api/packages/$OWNER/debian/pool/noble/main/upload" +# Gitea answers 409 for a version that is in the distribution already. +for DISTRIBUTION in $DISTRIBUTIONS; do + STATUS="$(curl -s -o "$BODY" -w '%{http_code}' --user "$OWNER:$PACKAGES_TOKEN" \ + --upload-file "$DEB" \ + "$SERVER_URL/api/packages/$OWNER/debian/pool/$DISTRIBUTION/main/upload")" + case "$STATUS" in + 2??) printf '%s %s is published in %s/main.\n' "$PACKAGE" "$VERSION" "$DISTRIBUTION" ;; + 409) printf '%s %s is already in %s/main, skipping.\n' "$PACKAGE" "$VERSION" "$DISTRIBUTION" ;; + *) printf 'ERROR: the upload to %s/main returned HTTP %s: %s\n' "$DISTRIBUTION" "$STATUS" "$(cat "$BODY")" >&2; exit 1 ;; + esac +done