X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Finspect.c;h=8b21026830d9a6711cca6220369a040b52da23a5;hb=e1aca6323e33e0dd50e23dc0d638f5789c9188e4;hp=baf4b3a015a80c897768f1f591aff8b6cf75a46e;hpb=fab75c0337d7897d10ea5e95e47ac05eab81ace9;p=libguestfs.git diff --git a/src/inspect.c b/src/inspect.c index baf4b3a..8b21026 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -1661,7 +1661,9 @@ guestfs__inspect_get_hostname (guestfs_h *g, const char *root) return safe_strdup (g, fs->hostname ? : "unknown"); } +#ifdef DB_DUMP static struct guestfs_application_list *list_applications_rpm (guestfs_h *g, struct inspect_fs *fs); +#endif static struct guestfs_application_list *list_applications_deb (guestfs_h *g, struct inspect_fs *fs); static struct guestfs_application_list *list_applications_windows (guestfs_h *g, struct inspect_fs *fs); static void add_application (guestfs_h *g, struct guestfs_application_list *, const char *name, const char *display_name, int32_t epoch, const char *version, const char *release, const char *install_path, const char *publisher, const char *url, const char *description); @@ -1683,9 +1685,11 @@ guestfs__inspect_list_applications (guestfs_h *g, const char *root) case OS_TYPE_LINUX: switch (fs->package_format) { case OS_PACKAGE_FORMAT_RPM: +#ifdef DB_DUMP ret = list_applications_rpm (g, fs); if (ret == NULL) return NULL; +#endif break; case OS_PACKAGE_FORMAT_DEB: @@ -1729,6 +1733,7 @@ guestfs__inspect_list_applications (guestfs_h *g, const char *root) return ret; } +#ifdef DB_DUMP static struct guestfs_application_list * list_applications_rpm (guestfs_h *g, struct inspect_fs *fs) { @@ -1744,7 +1749,7 @@ list_applications_rpm (guestfs_h *g, struct inspect_fs *fs) char line[1024]; size_t len; - snprintf (cmd, cmd_len, "db_dump -p '%s'", tmpfile); + snprintf (cmd, cmd_len, DB_DUMP " -p '%s'", tmpfile); if (g->verbose) fprintf (stderr, "list_applications_rpm: %s\n", cmd); @@ -1829,6 +1834,7 @@ list_applications_rpm (guestfs_h *g, struct inspect_fs *fs) return ret; } +#endif /* defined DB_DUMP */ static struct guestfs_application_list * list_applications_deb (guestfs_h *g, struct inspect_fs *fs) @@ -2346,6 +2352,7 @@ guestfs___free_inspect_info (guestfs_h *g) free (g->fses[i].device); free (g->fses[i].product_name); free (g->fses[i].arch); + free (g->fses[i].hostname); free (g->fses[i].windows_systemroot); size_t j; for (j = 0; j < g->fses[i].nr_fstab; ++j) {