Add support for pkgsrc, default NetBSD package manager.
authorMichael Scherer <misc@zarb.org>
Thu, 13 Oct 2011 23:05:07 +0000 (01:05 +0200)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 14 Oct 2011 09:27:48 +0000 (10:27 +0100)
For now, only detect the tool, but support from reading
installed package could be added later ( may require either
a package of pkgsrc, or a smaller tool to read the db ).

generator/generator_actions.ml
src/guestfs-internal.h
src/inspect.c
src/inspect_apps.c

index 60fca9b..02eb2ef 100644 (file)
@@ -1173,7 +1173,8 @@ This returns the string C<unknown> if we could not determine the
 package format I<or> if the operating system does not have
 a real packaging system (eg. Windows).
 
-Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>.
+Possible strings include:
+C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, C<pkgsrc>.
 Future versions of libguestfs may return other strings.
 
 Please read L<guestfs(3)/INSPECTION> for more details.");
index cee3048..eacf502 100644 (file)
@@ -284,7 +284,8 @@ enum inspect_os_package_format {
   OS_PACKAGE_FORMAT_DEB,
   OS_PACKAGE_FORMAT_PACMAN,
   OS_PACKAGE_FORMAT_EBUILD,
-  OS_PACKAGE_FORMAT_PISI
+  OS_PACKAGE_FORMAT_PISI,
+  OS_PACKAGE_FORMAT_PKGSRC,
 };
 
 enum inspect_os_package_management {
index 62cbc85..1432735 100644 (file)
@@ -456,6 +456,7 @@ guestfs__inspect_get_package_format (guestfs_h *g, const char *root)
   case OS_PACKAGE_FORMAT_PACMAN: ret = safe_strdup (g, "pacman"); break;
   case OS_PACKAGE_FORMAT_EBUILD: ret = safe_strdup (g, "ebuild"); break;
   case OS_PACKAGE_FORMAT_PISI: ret = safe_strdup (g, "pisi"); break;
+  case OS_PACKAGE_FORMAT_PKGSRC: ret = safe_strdup (g, "pkgsrc"); break;
   case OS_PACKAGE_FORMAT_UNKNOWN:
   default:
     ret = safe_strdup (g, "unknown");
index ba27247..a77da73 100644 (file)
@@ -90,6 +90,7 @@ guestfs__inspect_list_applications (guestfs_h *g, const char *root)
       case OS_PACKAGE_FORMAT_PACMAN:
       case OS_PACKAGE_FORMAT_EBUILD:
       case OS_PACKAGE_FORMAT_PISI:
+      case OS_PACKAGE_FORMAT_PKGSRC:
       case OS_PACKAGE_FORMAT_UNKNOWN:
       default:
         /* nothing - keep GCC happy */;