From: Richard Jones Date: Fri, 29 Oct 2010 09:21:33 +0000 (+0100) Subject: inspect: Add detection of Pardus. X-Git-Tag: 1.5.26~4 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=233530d3541dd67ce8fec7d9677cdf659c9d2900;p=libguestfs.git inspect: Add detection of Pardus. --- diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 086584c..4fadd17 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -787,6 +787,10 @@ Debian or a Debian-derived distro such as Ubuntu. Fedora. +=item \"pardus\" + +Pardus. + =item \"redhat-based\" Some Red Hat-derived distro. diff --git a/inspector/virt-inspector b/inspector/virt-inspector index 87da621..4936068 100755 --- a/inspector/virt-inspector +++ b/inspector/virt-inspector @@ -385,6 +385,10 @@ sub output_applications $package_format = "rpm"; $package_management = "yum"; } + elsif ($distro eq "pardus") { + $package_format = "pisi"; + $package_management = "pisi"; + } elsif ($distro =~ /redhat/ || $distro =~ /rhel/) { if ($major_version >= 5) { $package_format = "rpm"; diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 10c9503..529aa7d 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -166,6 +166,7 @@ enum inspect_os_distro { OS_DISTRO_REDHAT_BASED, OS_DISTRO_RHEL, OS_DISTRO_WINDOWS, + OS_DISTRO_PARDUS, }; struct inspect_fs { diff --git a/src/inspect.c b/src/inspect.c index 88f8bb1..8e42408 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -722,6 +722,15 @@ check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (parse_major_minor (g, fs) == -1) return -1; } + else if (guestfs_exists (g, "/etc/pardus-release") > 0) { + fs->distro = OS_DISTRO_PARDUS; + + if (parse_release_file (g, fs, "/etc/pardus-release") == -1) + return -1; + + if (parse_major_minor (g, fs) == -1) + return -1; + } /* Determine the architecture. */ const char *binaries[] = @@ -1238,6 +1247,7 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root) switch (fs->distro) { case OS_DISTRO_DEBIAN: ret = safe_strdup (g, "debian"); break; case OS_DISTRO_FEDORA: ret = safe_strdup (g, "fedora"); break; + case OS_DISTRO_PARDUS: ret = safe_strdup (g, "pardus"); break; case OS_DISTRO_REDHAT_BASED: ret = safe_strdup (g, "redhat-based"); break; case OS_DISTRO_RHEL: ret = safe_strdup (g, "rhel"); break; case OS_DISTRO_WINDOWS: ret = safe_strdup (g, "windows"); break;