summaryrefslogtreecommitdiffstats
path: root/packaging/repoconfig/build-deb.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 f1e0d7266..97f929a68 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