X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Finspect.c;h=46c7fe4e168877c826e8d673afd933dc62897d5b;hb=72f4b2e7493bf81b111ecd83490c9d3ad2480382;hp=e42dca866221af2cec08aa5e499995d08c095f5f;hpb=4f9a670d09b4d620fccc36e7c2df8fc912749f97;p=libguestfs.git diff --git a/src/inspect.c b/src/inspect.c index e42dca8..46c7fe4 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -609,8 +609,6 @@ check_linux_root (guestfs_h *g, struct inspect_fs *fs) static int check_freebsd_root (guestfs_h *g, struct inspect_fs *fs) { - int r; - fs->type = OS_TYPE_FREEBSD; /* FreeBSD has no authoritative version file. The version number is @@ -673,8 +671,6 @@ check_architecture (guestfs_h *g, struct inspect_fs *fs) static int check_hostname_unix (guestfs_h *g, struct inspect_fs *fs) { - char **lines; - switch (fs->type) { case OS_TYPE_LINUX: /* Red Hat-derived would be in /etc/sysconfig/network, and @@ -1661,7 +1657,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 +1681,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 +1729,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 +1745,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 +1830,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)