Blame SOURCES/0056-a-a-list-dsos-Fix-decoding-of-strings-from-rpm.patch

8f9a28
From f6e07167e8769219471b10a3c20fa64ada8ce61f Mon Sep 17 00:00:00 2001
8f9a28
From: Martin Kutlak <mkutlak@redhat.com>
8f9a28
Date: Fri, 12 Jul 2019 17:46:48 +0200
8f9a28
Subject: [PATCH] a-a-list-dsos: Fix decoding of strings from rpm
8f9a28
8f9a28
rpm used to return bytes but that was changed to return strings in recent release.
8f9a28
8f9a28
Related: rhbz#1693751
8f9a28
Resolves: rhbz#1694970
8f9a28
8f9a28
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
8f9a28
---
8f9a28
 abrt.spec.in                      |  1 +
8f9a28
 src/plugins/abrt-action-list-dsos | 13 ++++++-------
8f9a28
 2 files changed, 7 insertions(+), 7 deletions(-)
8f9a28
8f9a28
diff --git a/abrt.spec.in b/abrt.spec.in
8f9a28
index 03f1a67d..b9c9d5f1 100644
8f9a28
--- a/abrt.spec.in
8f9a28
+++ b/abrt.spec.in
8f9a28
@@ -233,6 +233,7 @@ Requires: python2-libreport
8f9a28
 %if %{with python3}
8f9a28
 Requires: python3-libreport
8f9a28
 %endif # with python3
8f9a28
+Requires: rpm >= 4.14.2-11
8f9a28
 
8f9a28
 %description addon-ccpp
8f9a28
 This package contains %{name}'s C/C++ analyzer plugin.
8f9a28
diff --git a/src/plugins/abrt-action-list-dsos b/src/plugins/abrt-action-list-dsos
8f9a28
index adb228a4..8bf5415e 100644
8f9a28
--- a/src/plugins/abrt-action-list-dsos
8f9a28
+++ b/src/plugins/abrt-action-list-dsos
8f9a28
@@ -84,15 +84,14 @@ if __name__ == "__main__":
8f9a28
                             outname = None
8f9a28
 
8f9a28
                         vendor = h[rpm.RPMTAG_VENDOR]
8f9a28
-                        if vendor != None:
8f9a28
-                            vendor = vendor.decode('utf-8')
8f9a28
+                        rpmtag_nevra = h[rpm.RPMTAG_NEVRA]
8f9a28
 
8f9a28
                         outfile.write("%s %s (%s) %s\n" %
8f9a28
-                                    (path,
8f9a28
-                                     h[rpm.RPMTAG_NEVRA].decode('utf-8'),
8f9a28
-                                     vendor,
8f9a28
-                                     h[rpm.RPMTAG_INSTALLTIME])
8f9a28
-                                    )
8f9a28
+                                      (path,
8f9a28
+                                       rpmtag_nevra,
8f9a28
+                                       vendor,
8f9a28
+                                       h[rpm.RPMTAG_INSTALLTIME])
8f9a28
+                                      )
8f9a28
 
8f9a28
         except Exception as ex:
8f9a28
             error_msg_and_die("Can't get the DSO list: %s" % ex)
8f9a28
-- 
8f9a28
2.21.0
8f9a28