From 2579e8f7152c3205691f3798a81d43c1af4e8af6 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 5 Apr 2017 16:56:24 +0200 Subject: [PATCH] build: Use tildes in Debian package versioning Makes their version sorting closer to the semver we expect. --- build.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.go b/build.go index b82ff5b55..cd5d13395 100644 --- a/build.go +++ b/build.go @@ -523,6 +523,10 @@ func buildDeb(target target) { debver := version if strings.HasPrefix(debver, "v") { debver = debver[1:] + // Debian interprets dashes as separator between main version and + // Debian package version, and thus thinks 0.14.26-rc.1 is better + // than just 0.14.26. This rectifies that. + debver = strings.Replace(debver, "-", "~", -1) } runPrint("fpm", "-t", "deb", "-s", "dir", "-C", "deb", "-n", "syncthing", "-v", debver, "-a", debarch,