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

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