Skip to contentSkip to conversation

buildhistory: do not error on version-going-backwards

PATCH New Alexander Kanavin 1 participant 1 message Sep 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildhistory: do not error on version-going-backwards

In some situation this may happen in initial builds and should not be treated as an error.

---
 modules/buildhistory.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
modules/buildhistory.py +10 -1
index edf9ae6..6649023 100644
@@ -40,7 +40,16 @@ class BuildHistory(object):
 
     def init(self, machines):
         for machine in machines:
-            self.bb.complete(self.pn, machine)
+            try:
+                self.bb.complete(self.pn, machine)
+            except Error as e:
+                for line in e.stdout.split("\n"):
+                    # version going backwards is not a real error
+                    if re.match(".* went backwards which would break package feeds .*", line):
+                        break
+                else:
+                    raise e
+
 
     def diff(self):
         try:
Signature · 1 line
2.28.0