fix(netdata-updater): fix major version detection for native packages (#21485)
Ilya Mashchenko committed
Dec 18, 2025 at 22:26 UTC
dfd6a9ce5e6c0d6f6b03c8c5e6cf34990733cf95
1 file changed
+3
-2
packaging/installer/netdata-updater.sh
+3
-2
@@ -1240,10 +1240,11 @@ update_binpkg() {
1240
fi
1241
fi
1242
1243
- current_major="$(echo "${nd_version}" | cut -f 1 -d '.' | tr -d 'v')"
1243
+ current_major="$(get_current_version | head -c 4 | awk '{ print $1 + 0 }')"
1244
latest_major="$(get_new_binpkg_major)"
1245
1246
- if [ -n "${latest_major}" ] && [ "${latest_major}" -ne "${current_major}" ]; then
1246
+ # current_major == 0 means we could not determine the installed version
1247
+ if [ -n "${latest_major}" ] && [ "${current_major}" -ne 0 ] && [ "${latest_major}" -ne "${current_major}" ]; then
1248
update_safe=0
1249
1250
for v in ${NETDATA_ACCEPT_MAJOR_VERSIONS}; do