summaryrefslogtreecommitdiff
path: root/currentVersions.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-26 17:20:25 -0500
committerJeff Carr <[email protected]>2025-10-26 17:20:25 -0500
commit1d1be3d8bc87361c76100147ef3c00aa2d5ce667 (patch)
treed9898714db9d230d584d33eb65101911b396c0ae /currentVersions.go
parent26f9c47ac64965275f3b0f001629aaac09ce5ae9 (diff)
use the smae codev0.0.174
Diffstat (limited to 'currentVersions.go')
-rw-r--r--currentVersions.go28
1 files changed, 8 insertions, 20 deletions
diff --git a/currentVersions.go b/currentVersions.go
index 8f727a9..0312737 100644
--- a/currentVersions.go
+++ b/currentVersions.go
@@ -123,35 +123,23 @@ func (repo *Repo) GetSmartVersion() string {
// takes off the GO 'v'
curver = trimNonNumericFromStart(curver)
+ patchCount := 0
parts := strings.Split(curver, "-")
- if len(parts) == 1 {
- curver += "-0"
- }
if len(parts) == 3 {
- curver = strings.Join(parts[0:2], "-")
+ patchCount, _ = strconv.Atoi(parts[1])
+ }
+ if repo.CheckDirty() {
+ patchCount += 1
}
+ curver = fmt.Sprintf("%s-%d", parts[0], patchCount)
return "v" + curver
}
func (repo *Repo) DebianCurrentVersion(buildnum int) string {
- curver := repo.GetCurrentBranchVersion()
+ smartver := repo.GetSmartVersion()
// takes off the GO 'v'
- curver = trimNonNumericFromStart(curver)
- if curver == "" {
- // need something for debian or it won't accept it
- curver = "0.0"
- }
-
- // .deb files don't like "v0.0.90-1-g778234j"
- // so remove the end so it's "0.0.90-1"
- parts := strings.Split(curver, "-")
- if len(parts) == 1 {
- curver = curver + "-0" // patches then show up as "-1", "-2", etc
- }
- if len(parts) > 1 {
- curver = strings.Join(parts[0:2], "-")
- }
+ curver := trimNonNumericFromStart(smartver)
// removing the checks for '0' and doing this everytime
// TODO: verify apt behavior without it (probably not worth it however. always add +bXXX