summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorJohn Eckersberg <jeckersb@redhat.com>2012-11-01 13:35:15 -0400
committerRichard W.M. Jones <rjones@redhat.com>2012-11-01 18:22:01 +0000
commitbafd8229149ccc0e05676e031bae5d1489fa74a6 (patch)
treee220da3ff72493a0ef2a2226ed11913d8c1ecd43 /generator
parent4c285dd8f6a263ed62802af2c89c4cc75497c1ce (diff)
downloadlibguestfs-bafd8229149ccc0e05676e031bae5d1489fa74a6.tar.gz
libguestfs-bafd8229149ccc0e05676e031bae5d1489fa74a6.tar.xz
libguestfs-bafd8229149ccc0e05676e031bae5d1489fa74a6.zip
lib: Add inspect_list_applications2 method (RHBZ#859949)
RWMJ: - Fix memory leak in guestfs__inspect_list_applications wrapper. - Don't document app2_spare* fields.
Diffstat (limited to 'generator')
-rw-r--r--generator/actions.ml104
-rw-r--r--generator/structs.ml24
2 files changed, 128 insertions, 0 deletions
diff --git a/generator/actions.ml b/generator/actions.ml
index 71aee379..5d713478 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -1521,6 +1521,7 @@ Please read L<guestfs(3)/INSPECTION> for more details." };
{ defaults with
name = "inspect_list_applications";
style = RStructList ("applications", "application"), [Device "root"], [];
+ deprecated_by = Some "inspect_list_applications2";
shortdesc = "get list of applications installed in the operating system";
longdesc = "\
Return the list of applications installed in the operating system.
@@ -1616,6 +1617,109 @@ If unavailable this is returned as an empty string C<\"\">.
Please read L<guestfs(3)/INSPECTION> for more details." };
{ defaults with
+ name = "inspect_list_applications2";
+ style = RStructList ("applications2", "application2"), [Device "root"], [];
+ shortdesc = "get list of applications installed in the operating system";
+ longdesc = "\
+Return the list of applications installed in the operating system.
+
+I<Note:> This call works differently from other parts of the
+inspection API. You have to call C<guestfs_inspect_os>, then
+C<guestfs_inspect_get_mountpoints>, then mount up the disks,
+before calling this. Listing applications is a significantly
+more difficult operation which requires access to the full
+filesystem. Also note that unlike the other
+C<guestfs_inspect_get_*> calls which are just returning
+data cached in the libguestfs handle, this call actually reads
+parts of the mounted filesystems during the call.
+
+This returns an empty list if the inspection code was not able
+to determine the list of applications.
+
+The application structure contains the following fields:
+
+=over 4
+
+=item C<app2_name>
+
+The name of the application. For Red Hat-derived and Debian-derived
+Linux guests, this is the package name.
+
+=item C<app2_display_name>
+
+The display name of the application, sometimes localized to the
+install language of the guest operating system.
+
+If unavailable this is returned as an empty string C<\"\">.
+Callers needing to display something can use C<app2_name> instead.
+
+=item C<app2_epoch>
+
+For package managers which use epochs, this contains the epoch of
+the package (an integer). If unavailable, this is returned as C<0>.
+
+=item C<app2_version>
+
+The version string of the application or package. If unavailable
+this is returned as an empty string C<\"\">.
+
+=item C<app2_release>
+
+The release string of the application or package, for package
+managers that use this. If unavailable this is returned as an
+empty string C<\"\">.
+
+=item C<app2_arch>
+
+The architecture string of the application or package, for package
+managers that use this. If unavailable this is returned as an empty
+string C<\"\">.
+
+=item C<app2_install_path>
+
+The installation path of the application (on operating systems
+such as Windows which use installation paths). This path is
+in the format used by the guest operating system, it is not
+a libguestfs path.
+
+If unavailable this is returned as an empty string C<\"\">.
+
+=item C<app2_trans_path>
+
+The install path translated into a libguestfs path.
+If unavailable this is returned as an empty string C<\"\">.
+
+=item C<app2_publisher>
+
+The name of the publisher of the application, for package
+managers that use this. If unavailable this is returned
+as an empty string C<\"\">.
+
+=item C<app2_url>
+
+The URL (eg. upstream URL) of the application.
+If unavailable this is returned as an empty string C<\"\">.
+
+=item C<app2_source_package>
+
+For packaging systems which support this, the name of the source
+package. If unavailable this is returned as an empty string C<\"\">.
+
+=item C<app2_summary>
+
+A short (usually one line) description of the application or package.
+If unavailable this is returned as an empty string C<\"\">.
+
+=item C<app2_description>
+
+A longer description of the application or package.
+If unavailable this is returned as an empty string C<\"\">.
+
+=back
+
+Please read L<guestfs(3)/INSPECTION> for more details." };
+
+ { defaults with
name = "inspect_get_hostname";
style = RString "hostname", [Device "root"], [];
shortdesc = "get hostname of the operating system";
diff --git a/generator/structs.ml b/generator/structs.ml
index 4dcb2c9a..207da90c 100644
--- a/generator/structs.ml
+++ b/generator/structs.ml
@@ -230,6 +230,30 @@ let structs = [
];
s_camel_name = "Application" };
+ (* Application v2. *)
+ { defaults with
+ s_name = "application2";
+ s_cols = [
+ "app2_name", FString;
+ "app2_display_name", FString;
+ "app2_epoch", FInt32;
+ "app2_version", FString;
+ "app2_release", FString;
+ "app2_arch", FString;
+ "app2_install_path", FString;
+ "app2_trans_path", FString;
+ "app2_publisher", FString;
+ "app2_url", FString;
+ "app2_source_package", FString;
+ "app2_summary", FString;
+ "app2_description", FString;
+ "app2_spare1", FString;
+ "app2_spare2", FString;
+ "app2_spare3", FString;
+ "app2_spare4", FString;
+ ];
+ s_camel_name = "Application2" };
+
(* ISO primary volume descriptor. *)
{ defaults with
s_name = "isoinfo";