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 <rodrigo.chiossi@intel.com>
This commit is contained in:
Rodrigo Chiossi
2018-06-19 17:30:14 -07:00
committed by tmarcu
parent fc39e15d2c
commit 38bfdd2297
+2
View File
@@ -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)