---
 lib/inspect-apps.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/inspect-apps.c b/lib/inspect-apps.c
index f0cf16b38..020a3332c 100644
--- a/lib/inspect-apps.c
+++ b/lib/inspect-apps.c
@@ -122,9 +122,14 @@ guestfs_impl_inspect_list_applications2 (guestfs_h *g, 
const char *root)
   if (STREQ (type, "linux") || STREQ (type, "hurd")) {
     if (STREQ (package_format, "rpm")) {
 #ifdef DB_DUMP
-      ret = list_applications_rpm (g, root);
-      if (ret == NULL)
-        return NULL;
+      /* Allow db_dump to be missing at runtime so that it can be
+       * installed as a weak dependency.
+       */
+      if (system (DB_DUMP " -V >/dev/null 2>&1") == 0) {
+        ret = list_applications_rpm (g, root);
+        if (ret == NULL)
+          return NULL;
+      }
 #endif
     }
     else if (STREQ (package_format, "deb")) {
-- 
2.13.2

_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to