Generalize Debian distro CI packaging
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2026-05-05 11:54:48 +02:00
parent 6adf479d39
commit 95186bbb94
4 changed files with 178 additions and 12 deletions

View File

@@ -2,15 +2,40 @@
set -euo pipefail
source "$(cd "$(dirname "$0")/.." && pwd)/lib/common.sh"
export DEBIAN_FRONTEND=noninteractive
distribution_id="$(detect_debian_distribution_id)"
distribution_codename="$(detect_debian_distribution)"
refresh_package_indexes=false
log "Bootstrapping APT packages for $distribution_id:$distribution_codename"
printf 'Acquire::http::Proxy "http://cbrapt01.lan.cyber.gent:3142";\n' >/etc/apt/apt.conf.d/80proxy
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends build-essential
apt-get install -y --no-install-recommends software-properties-common
add-apt-repository -y universe
apt-get update
case "$distribution_id" in
ubuntu)
apt-get install -y --no-install-recommends software-properties-common
if ! grep -RqsE '(^|[[:space:]])universe([[:space:]]|$)' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null; then
add-apt-repository -y universe
refresh_package_indexes=true
fi
;;
debian)
;;
*)
die "Unsupported distribution ID: $distribution_id"
;;
esac
if [[ "$refresh_package_indexes" == true ]]; then
apt-get update
fi
apt-get install -y --no-install-recommends \
autoconf \
automake \

View File

@@ -80,6 +80,7 @@ package_name="$(dpkg-deb -f "$raw_package_path" Package)"
package_version="$(dpkg-deb -f "$raw_package_path" Version)"
package_arch="$(dpkg-deb -f "$raw_package_path" Architecture)"
artifact_path="$artifacts_dir/${package_name}_${package_version}_${package_arch}.deb"
package_distribution="${DEBIAN_DISTRIBUTION:-$(detect_debian_distribution)}"
if [[ "$raw_package_path" != "$artifact_path" ]]; then
cp "$raw_package_path" "$artifact_path"
@@ -90,7 +91,7 @@ PACKAGE_FILE=$artifact_path
PACKAGE_NAME=$package_name
PACKAGE_VERSION=$package_version
PACKAGE_ARCHITECTURE=$package_arch
PACKAGE_DISTRIBUTION=${DEBIAN_DISTRIBUTION:-$DEFAULT_DEBIAN_DISTRIBUTION}
PACKAGE_DISTRIBUTION=$package_distribution
PACKAGE_COMPONENT=${DEBIAN_COMPONENT:-$DEFAULT_DEBIAN_COMPONENT}
EOF