diff options
Diffstat (limited to 'currentVersions.go')
| -rw-r--r-- | currentVersions.go | 28 |
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 |
