From 38bfdd2297a999d857737f1b95cbea8a02f42404 Mon Sep 17 00:00:00 2001 From: Rodrigo Chiossi Date: Fri, 15 Jun 2018 17:18:07 -0700 Subject: [PATCH] format: Restore upstream version before bump check Since we build +20 before +10, when finishing the +10 build the upstream points to the old upstream version. This means that fetching the format will get +10 format instead of the +20 format which will make checkBumpNeeded() erroneously return true. This patch fix a crash where format bump would loop forever until it hit a format beyond the last existing one and crash. Signed-off-by: Rodrigo Chiossi --- mixer/cmd/build.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mixer/cmd/build.go b/mixer/cmd/build.go index 340f276..e7e79d4 100644 --- a/mixer/cmd/build.go +++ b/mixer/cmd/build.go @@ -156,6 +156,8 @@ var buildUpstreamFormatCmd = &cobra.Command{ if err = b.UnstageMixFromBump(); err != nil { fail(err) } + b.UpstreamVerUint32 += 10 + b.UpstreamVer = strconv.FormatUint(uint64(b.UpstreamVerUint32), 10) bumpNeeded, err = b.CheckBumpNeeded(silent) if err != nil { fail(err)