]> sourceware.org Git - libabigail.git/commitdiff
Don't bail because "rpm" issued an error
authorDodji Seketeli <dodji@redhat.com>
Wed, 16 May 2018 15:52:17 +0000 (17:52 +0200)
committerDodji Seketeli <dodji@redhat.com>
Thu, 17 May 2018 07:22:02 +0000 (09:22 +0200)
It turns out that the "rpm -qp --provides <rpm>" can issue an error on
el6 (on the RPMs that we feed it) and still provide us with the output
we want.  So we shouldn't just fail in that case.

This patch handles that case.

* src/abg-tools-utils.cc (get_dsos_provided_by_rpm): Do not fail
when the rpm command issues an error.  Rather rely on the presence
of a valid output or not.  Also, make sure to filter out error
outputs so that they don't appear in the general output of tools
using this function.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-tools-utils.cc

index c560fb0132e250c3e60ab9813c1e4a8130ecea48..a9787a156f57fc700eb227e09e806748eb39e32d 100644 (file)
@@ -854,10 +854,13 @@ bool
 get_dsos_provided_by_rpm(const string& rpm_path, set<string>& provided_dsos)
 {
   vector<string> query_output;
-  if (!execute_command_and_get_output("rpm -qp --provides "
-                                     + rpm_path + " | grep .so",
-                                     query_output))
-    return false;
+  // We don't check the return value of this command because on some
+  // system, the command can issue errors but still emit a valid
+  // output.  We'll rather rely on the fact that the command emits a
+  // valid output or not.
+  execute_command_and_get_output("rpm -qp --provides "
+                                + rpm_path + " 2> /dev/null | grep .so",
+                                query_output);
 
   for (vector<string>::const_iterator line = query_output.begin();
        line != query_output.end();
This page took 0.036027 seconds and 5 git commands to generate.