[auh] buildhistory: do not error on version-going-backwards

Submitted by Alexander Kanavin on Sept. 15, 2020, 5:30 p.m. | Patch ID: 176542

Details

Message ID 20200915173033.26706-1-alex.kanavin@gmail.com
State New
Headers show

Commit Message

Alexander Kanavin Sept. 15, 2020, 5:30 p.m.
In some situation this may happen in initial builds and
should not be treated as an error.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 modules/buildhistory.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/modules/buildhistory.py b/modules/buildhistory.py
index edf9ae6..6649023 100644
--- a/modules/buildhistory.py
+++ b/modules/buildhistory.py
@@ -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: