summaryrefslogtreecommitdiffstats
path: root/packaging/repoconfig/build-deb.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
commit89f3604407aff8f4cb2ed958252c61e23c767e24 (patch)
tree7fbf408102cab051557d38193524d8c6e991d070 /packaging/repoconfig/build-deb.sh
parentAdding upstream version 1.34.1. (diff)
downloadnetdata-89f3604407aff8f4cb2ed958252c61e23c767e24.tar.xz
netdata-89f3604407aff8f4cb2ed958252c61e23c767e24.zip
Adding upstream version 1.35.0.upstream/1.35.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/repoconfig/build-deb.sh')
-rwxr-xr-xpackaging/repoconfig/build-deb.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/packaging/repoconfig/build-deb.sh b/packaging/repoconfig/build-deb.sh
index f1e0d726..97f929a6 100755
--- a/packaging/repoconfig/build-deb.sh
+++ b/packaging/repoconfig/build-deb.sh
@@ -1,5 +1,9 @@
#!/bin/sh
+# Extract distro info from /etc/os-release
+DISTVERS="$(awk -F'"' '/VERSION_ID=/ {print $2}' /etc/os-release)"
+DISTNAME="$(awk -F'=' '/^ID=/ {print $2}' /etc/os-release)"
+
# Needed because dpkg is stupid and tries to configure things interactively if it sees a terminal.
export DEBIAN_FRONTEND=noninteractive
@@ -21,6 +25,19 @@ else
dpkg-buildpackage -b -us -uc || exit 1
fi
+# Embed distro info in package name.
+# This is required to make the repo actually standards compliant wthout packageclouds hacks.
+distid="${DISTNAME}${DISTVERS}"
+for pkg in /usr/src/*.deb; do
+ pkgname="$(basename "${pkg}" .deb)"
+ name="$(echo "${pkgname}" | cut -f 1 -d '_')"
+ version="$(echo "${pkgname}" | cut -f 2 -d '_')"
+ arch="$(echo "${pkgname}" | cut -f 3 -d '_')"
+
+ newname="$(dirname "${pkg}")/${name}_${version}+${distid}_${arch}.deb"
+ mv "${pkg}" "${newname}"
+done
+
# Copy the built packages to /netdata/artifacts (which may be bind-mounted)
# Also ensure /netdata/artifacts exists and create it if it doesn't
[ -d /netdata/artifacts ] || mkdir -p /netdata/artifacts