From 6bc2784e9acd943bd97654d0666f63a52b12b0b6 Mon Sep 17 00:00:00 2001 From: bt90 Date: Thu, 3 Apr 2025 14:28:33 +0200 Subject: [PATCH] build: replace underscore in Debian version (#10032) The workflow building Debian packages chokes on branches containing underscores: ``` {:timestamp=>"2025-04-03T10:31:46.749835+0000", :message=>"Invalid package configuration: The version looks invalid for Debian packages. Debian version field must contain only alphanumerics and . (period), + (plus), - (hyphen) or ~ (tilde). I have '1.29.5~dev.13.ga38df11f~srv_stun' which which isn't valid.", :level=>:error} ``` This replaces the offending `_` with a `~` which should yield a valid version. --- build.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.go b/build.go index 08d81414e..8b43a2b18 100644 --- a/build.go +++ b/build.go @@ -645,6 +645,9 @@ func buildDeb(target target) { // than just 0.14.26. This rectifies that. debver = strings.Replace(debver, "-", "~", -1) } + if strings.Contains(debver, "_") { + debver = strings.Replace(debver, "_", "~", -1) + } args := []string{ "-t", "deb", "-s", "dir",