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

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