diff options
Diffstat (limited to 'poky/bitbake/lib/toaster/toastergui/widgets.py')
-rw-r--r-- | poky/bitbake/lib/toaster/toastergui/widgets.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/poky/bitbake/lib/toaster/toastergui/widgets.py b/poky/bitbake/lib/toaster/toastergui/widgets.py index a1792d997..feef7c5d9 100644 --- a/poky/bitbake/lib/toaster/toastergui/widgets.py +++ b/poky/bitbake/lib/toaster/toastergui/widgets.py @@ -511,13 +511,18 @@ class MostRecentBuildsView(View): buildrequest_id = build_obj.buildrequest.pk build['buildrequest_id'] = buildrequest_id - build['recipes_parsed_percentage'] = \ - int((build_obj.recipes_parsed / - build_obj.recipes_to_parse) * 100) - - build['repos_cloned_percentage'] = \ - int((build_obj.repos_cloned / - build_obj.repos_to_clone) * 100) + if build_obj.recipes_to_parse > 0: + build['recipes_parsed_percentage'] = \ + int((build_obj.recipes_parsed / + build_obj.recipes_to_parse) * 100) + else: + build['recipes_parsed_percentage'] = 0 + if build_obj.repos_to_clone > 0: + build['repos_cloned_percentage'] = \ + int((build_obj.repos_cloned / + build_obj.repos_to_clone) * 100) + else: + build['repos_cloned_percentage'] = 0 tasks_complete_percentage = 0 if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED): |