From: Richard W.M. Jones Date: Fri, 25 Mar 2011 11:22:38 +0000 (+0000) Subject: inspector: Add detection of Slackware. X-Git-Tag: 1.9.14~9 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=23b7c92b0dab43c6feaa137eaf46260f28cdc1f1;p=libguestfs.git inspector: Add detection of Slackware. --- diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 11144e8..75b1cb3 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -827,6 +827,10 @@ Some Red Hat-derived distro. Red Hat Enterprise Linux and some derivatives. +=item \"slackware\" + +Slackware. + =item \"ubuntu\" Ubuntu. diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 155763d..b5f50c9 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -211,6 +211,7 @@ enum inspect_os_distro { OS_DISTRO_MEEGO, OS_DISTRO_LINUX_MINT, OS_DISTRO_MANDRIVA, + OS_DISTRO_SLACKWARE, }; enum inspect_os_package_format { diff --git a/src/inspect.c b/src/inspect.c index b4acf17..3a8ede6 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -645,6 +645,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/slackware-version") > 0) { + fs->distro = OS_DISTRO_SLACKWARE; + + if (parse_release_file (g, fs, "/etc/slackware-version") == -1) + return -1; + + if (parse_major_minor (g, fs) == -1) + return -1; + } skip_release_checks:; @@ -1784,6 +1793,7 @@ check_package_format (guestfs_h *g, struct inspect_fs *fs) fs->package_format = OS_PACKAGE_FORMAT_PISI; break; + case OS_DISTRO_SLACKWARE: case OS_DISTRO_WINDOWS: case OS_DISTRO_UNKNOWN: default: @@ -1828,6 +1838,7 @@ check_package_management (guestfs_h *g, struct inspect_fs *fs) fs->package_management = OS_PACKAGE_MANAGEMENT_URPMI; break; + case OS_DISTRO_SLACKWARE: case OS_DISTRO_WINDOWS: case OS_DISTRO_UNKNOWN: default: @@ -1935,6 +1946,7 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root) 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_SLACKWARE: ret = safe_strdup (g, "slackware"); break; case OS_DISTRO_WINDOWS: ret = safe_strdup (g, "windows"); break; case OS_DISTRO_UBUNTU: ret = safe_strdup (g, "ubuntu"); break; case OS_DISTRO_UNKNOWN: default: ret = safe_strdup (g, "unknown"); break;