Port upstream API patch

Port an addition in libreport Python API from upstream in order to
hotfix interoperability with abrt.

The commit in question:
cbb6b43038

Resolves rhbz#1906405
This commit is contained in:
Matěj Grabovský 2020-12-11 12:29:09 +01:00
parent 0cacf21d88
commit df126de8c3
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From cbb6b43038f0d88b28197ba905ba9324c0602945 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= <mgrabovs@redhat.com>
Date: Thu, 3 Sep 2020 15:05:23 +0200
Subject: [PATCH] client-python: Add getter for package count to downloader
Add a new method get_package_count() to the DebugInfoDownload class
which returns the number of packages that will be downloaded.
---
src/client-python/reportclient/debuginfo.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/client-python/reportclient/debuginfo.py b/src/client-python/reportclient/debuginfo.py
index cb318e8a..eeb2be30 100644
--- a/src/client-python/reportclient/debuginfo.py
+++ b/src/client-python/reportclient/debuginfo.py
@@ -242,6 +242,9 @@ class DebugInfoDownload(object):
def get_install_size(self):
return self.installed_size
+ def get_package_count(self):
+ return len(self.package_files_dict)
+
def mute_stdout(self):
"""
Links sys.stdout with /dev/null and saves the old stdout
--
2.26.2

View File

@ -15,7 +15,7 @@
Summary: Generic library for reporting various problems Summary: Generic library for reporting various problems
Name: libreport Name: libreport
Version: 2.14.0 Version: 2.14.0
Release: 12%{?dist} Release: 13%{?dist}
License: GPLv2+ License: GPLv2+
URL: https://abrt.readthedocs.org/ URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
@ -28,6 +28,7 @@ Patch4: 0005-gui-wizard-gtk-Fix-segfault.patch
Patch5: 0006-event_config-Null-autofree-pointers-before-returning.patch Patch5: 0006-event_config-Null-autofree-pointers-before-returning.patch
Patch6: 0007-gui-wizard-gtk-Don-t-autofree-URL-string.patch Patch6: 0007-gui-wizard-gtk-Don-t-autofree-URL-string.patch
Patch7: 0008-rhbz-Fix-a-double-free-condition.patch Patch7: 0008-rhbz-Fix-a-double-free-condition.patch
Patch8: 0009-client-python-Add-getter-for-package-count-to-downlo.patch
BuildRequires: %{dbus_devel} BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel BuildRequires: gtk3-devel