From 23ab40ab3fa9c3f0372575286aac05fe22d27949 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Mon, 2 Oct 2017 09:17:35 -0400 Subject: [PATCH] Fix write_sum_file/write_try_build_sum_file "confusion" when building the first commit of the builder/branch. --- lib/gdbcommand.py | 12 ++++++++++-- lib/sumfiles.py | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/gdbcommand.py b/lib/gdbcommand.py index cf15dde..0f89502 100644 --- a/lib/gdbcommand.py +++ b/lib/gdbcommand.py @@ -87,7 +87,11 @@ class GdbCatSumfileCommand(steps.ShellCommand): if not os.path.exists (db_file): # This takes care of our very first build. - parser.write_sum_file (cur_results, builder, branch, rev, istry) + if istry: + parser.write_try_build_sum_file (cur_results, builder, branch, + rev, 0) + else: + parser.write_sum_file (cur_results, builder, branch, rev, istry) # If there was no previous baseline, then this run # gets the honor. if baseline is None: @@ -105,7 +109,11 @@ class GdbCatSumfileCommand(steps.ShellCommand): prevcommit = prev[0] else: # This takes care of our very first build. - parser.write_sum_file (cur_results, builder, branch, rev, istry) + if istry: + parser.write_try_build_sum_file (cur_results, builder, branch, + rev, 0) + else: + parser.write_sum_file (cur_results, builder, branch, rev, istry) # If there was no previous baseline, then this run # gets the honor. if baseline is None: diff --git a/lib/sumfiles.py b/lib/sumfiles.py index e59ddfc..aed9713 100644 --- a/lib/sumfiles.py +++ b/lib/sumfiles.py @@ -95,9 +95,10 @@ class DejaResults(object): f.write (sum_dict[0][k] + ': ' + k + '\n') os.umask (old_umask) - def write_sum_file(self, sum_dict, builder, branch, rev, istry): + def write_sum_file(self, sum_dict, builder, branch, rev, istry, try_count = 0): if istry: - self.write_try_build_sum_file (self, sum_dict, builder, branch, rev) + self.write_try_build_sum_file (self, sum_dict, builder, branch, rev, + try_count = try_count) else: self._write_sum_file (sum_dict, builder, rev, 'gdb.sum', istry = False, branch = branch)