summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-09-26 12:49:49 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-09-29 11:53:26 +0200
commite50ae95cdfd5a4967708b99ad7ff803f62cd623a (patch)
treec7d0f2725459701c5d8205a1fad976b636f8260b
parent7e4a27bee8891742af6ca48ad1939f2f7e2f1a31 (diff)
Fix removal of state json file when the batch update is done
The file is not called state.json anymore :) Change-Id: I84a59430951c3103df8103ded0f71e88c66b4109 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rw-r--r--src/qtmoduleupdater/main.go4
-rw-r--r--src/qtmoduleupdater/moduleupdatebatch.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/qtmoduleupdater/main.go b/src/qtmoduleupdater/main.go
index 5ef5d0d8..709476dc 100644
--- a/src/qtmoduleupdater/main.go
+++ b/src/qtmoduleupdater/main.go
@@ -123,14 +123,14 @@ func appMain() error {
return err
}
} else {
- os.Remove("state.json")
-
if batch.FailedModuleCount == 0 {
fmt.Println("Preparing qt5 update")
if err = prepareQt5Update(product, batch.Branch, batch.Done, pushUserName, manualStage); err != nil {
return fmt.Errorf("error preparing qt5 update: %s", err)
}
}
+
+ batch.clearState()
}
return nil
diff --git a/src/qtmoduleupdater/moduleupdatebatch.go b/src/qtmoduleupdater/moduleupdatebatch.go
index 6eabde02..11b73f43 100644
--- a/src/qtmoduleupdater/moduleupdatebatch.go
+++ b/src/qtmoduleupdater/moduleupdatebatch.go
@@ -198,6 +198,10 @@ func (batch *ModuleUpdateBatch) loadState() error {
return nil
}
+func (batch *ModuleUpdateBatch) clearState() {
+ os.Remove(batch.stateFileName())
+}
+
func (batch *ModuleUpdateBatch) isDone() bool {
return len(batch.Todo) == 0 && len(batch.Pending) == 0
}