summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2020-11-06 07:07:08 -0500
committerGitHub <noreply@github.com>2020-11-06 07:07:08 -0500
commitb873b655ce2adb75cac07decfb8e2687e8fa8c6c (patch)
tree00b33eb6d2a5d704f5e1373f58f5aee174c46e80 /packaging
parentfddc8510887eadec5fdfd744f80677874f0d313d (diff)
Fixed two bugs related to version handling in install and update code. (#10162)
* Try to update local tags during build to ensure consistent version. By default, `git` does not update the list of tags for a repository after it is first cloned unless you explicitly tell it to do so. Because we use the most recent tag as the first part of our version number, this can lead to strange ancient-looking version numbers that are actually far more recent (for example, `v1.11.1-2915-g6106dd7`, which is actually from v1.21.1 sources), potentially causing confusion with respect to support. This adds code to `netdata-installer.sh` to try to update the local repo with the remote tags to ensure that we actually have sane version numbers. * Use 5 digits for commit count in version number comparison. The original code in `netdata-updater.sh` includes a hard-coded assumption that a version number will never have more than 3 digits for the commit count. This is of course wrong in a handful of cases, which will then get stuck on the older version because of the effects of digit counts on comparisons. This updates from our current 999 commit limit to a limit of 99999 commits, which is a reasonable expectation that we should never get _that_ far.
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/installer/netdata-updater.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh
index 0ce0cba9bd..faadc4ea3a 100755
--- a/packaging/installer/netdata-updater.sh
+++ b/packaging/installer/netdata-updater.sh
@@ -133,7 +133,7 @@ parse_version() {
fi
read -r -a pp <<< "$(echo "${v}" | tr '.' ' ')"
- printf "%03d%03d%03d%03d" "${pp[0]}" "${pp[1]}" "${pp[2]}" "${b}"
+ printf "%03d%03d%03d%05d" "${pp[0]}" "${pp[1]}" "${pp[2]}" "${b}"
}
get_latest_version() {