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