Browse Source

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.
bt90 8 months ago
parent
commit
6bc2784e9a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      build.go

+ 3 - 0
build.go

@@ -645,6 +645,9 @@ func buildDeb(target target) {
 		// than just 0.14.26. This rectifies that.
 		// than just 0.14.26. This rectifies that.
 		debver = strings.Replace(debver, "-", "~", -1)
 		debver = strings.Replace(debver, "-", "~", -1)
 	}
 	}
+	if strings.Contains(debver, "_") {
+		debver = strings.Replace(debver, "_", "~", -1)
+	}
 	args := []string{
 	args := []string{
 		"-t", "deb",
 		"-t", "deb",
 		"-s", "dir",
 		"-s", "dir",