<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="PkServicePack">
<refmeta>
<refentrytitle role="top_of_page" id="PkServicePack.top_of_page">PkServicePack</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PACKAGEKIT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>PkServicePack</refname>
<refpurpose>Functionality for creating and reading service packs</refpurpose>
</refnamediv>

<refsynopsisdiv id="PkServicePack.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
#define             <link linkend="PK-SERVICE-PACK-ERROR--CAPS">PK_SERVICE_PACK_ERROR</link>
#define             <link linkend="PK-SERVICE-PACK-TYPE-ERROR--CAPS">PK_SERVICE_PACK_TYPE_ERROR</link>
#define             <link linkend="PK-SERVICE-PACK-FILE-EXTENSION--CAPS">PK_SERVICE_PACK_FILE_EXTENSION</link>
enum                <link linkend="PkServicePackError">PkServicePackError</link>;
                    <link linkend="PkServicePackPrivate">PkServicePackPrivate</link>;
                    <link linkend="PkServicePack-struct">PkServicePack</link>;
<link linkend="GQuark">GQuark</link>              <link linkend="pk-service-pack-error-quark">pk_service_pack_error_quark</link>         (void);
<link linkend="GType">GType</link>               <link linkend="pk-service-pack-get-type">pk_service_pack_get_type</link>            (void);
<link linkend="PkServicePack">PkServicePack</link> *     <link linkend="pk-service-pack-new">pk_service_pack_new</link>                 (void);
<link linkend="void">void</link>                <link linkend="pk-service-pack-test">pk_service_pack_test</link>                (<link linkend="gpointer">gpointer</link> user_data);
<link linkend="gboolean">gboolean</link>            <link linkend="pk-service-pack-check-valid">pk_service_pack_check_valid</link>         (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="pk-service-pack-set-temp-directory">pk_service_pack_set_temp_directory</link>  (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *directory);
<link linkend="gboolean">gboolean</link>            <link linkend="pk-service-pack-generic-finish">pk_service_pack_generic_finish</link>      (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *res,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="pk-service-pack-create-for-package-ids-async">pk_service_pack_create_for_package_ids_async</link>
                                                        (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="gchar">gchar</link> **package_ids_exclude,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="void">void</link>                <link linkend="pk-service-pack-create-for-updates-async">pk_service_pack_create_for_updates_async</link>
                                                        (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="gchar">gchar</link> **package_ids_exclude,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsynopsisdiv>

<refsect1 id="PkServicePack.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----PkServicePack
</synopsis>
</refsect1>








<refsect1 id="PkServicePack.description" role="desc">
<title role="desc.title">Description</title>
<para>
Clients can use this GObject for reading and writing service packs.</para>
<para>
</para>
</refsect1>

<refsect1 id="PkServicePack.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="PK-SERVICE-PACK-ERROR--CAPS" role="macro">
<title>PK_SERVICE_PACK_ERROR</title>
<indexterm zone="PK-SERVICE-PACK-ERROR--CAPS"><primary sortas="PK_SERVICE_PACK_ERROR">PK_SERVICE_PACK_ERROR</primary></indexterm><programlisting>#define PK_SERVICE_PACK_ERROR	 	(pk_service_pack_error_quark ())
</programlisting>
<para>
</para></refsect2>
<refsect2 id="PK-SERVICE-PACK-TYPE-ERROR--CAPS" role="macro">
<title>PK_SERVICE_PACK_TYPE_ERROR</title>
<indexterm zone="PK-SERVICE-PACK-TYPE-ERROR--CAPS"><primary sortas="PK_SERVICE_PACK_TYPE_ERROR">PK_SERVICE_PACK_TYPE_ERROR</primary></indexterm><programlisting>#define PK_SERVICE_PACK_TYPE_ERROR	(pk_service_pack_error_get_type ())
</programlisting>
<para>
</para></refsect2>
<refsect2 id="PK-SERVICE-PACK-FILE-EXTENSION--CAPS" role="macro">
<title>PK_SERVICE_PACK_FILE_EXTENSION</title>
<indexterm zone="PK-SERVICE-PACK-FILE-EXTENSION--CAPS"><primary sortas="PK_SERVICE_PACK_FILE_EXTENSION">PK_SERVICE_PACK_FILE_EXTENSION</primary></indexterm><programlisting>#define PK_SERVICE_PACK_FILE_EXTENSION	"servicepack"
</programlisting>
<para>
</para></refsect2>
<refsect2 id="PkServicePackError" role="enum">
<title>enum PkServicePackError</title>
<indexterm zone="PkServicePackError"><primary sortas="PkServicePackError">PkServicePackError</primary></indexterm><programlisting>typedef enum
{
	PK_SERVICE_PACK_ERROR_FAILED_SETUP,
	PK_SERVICE_PACK_ERROR_FAILED_DOWNLOAD,
	PK_SERVICE_PACK_ERROR_FAILED_EXTRACTION,
	PK_SERVICE_PACK_ERROR_FAILED_CREATE,
	PK_SERVICE_PACK_ERROR_NOTHING_TO_DO,
	PK_SERVICE_PACK_ERROR_NOT_COMPATIBLE
} PkServicePackError;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="PkServicePackPrivate" role="struct">
<title>PkServicePackPrivate</title>
<indexterm zone="PkServicePackPrivate"><primary sortas="PkServicePackPrivate">PkServicePackPrivate</primary></indexterm><programlisting>typedef struct _PkServicePackPrivate PkServicePackPrivate;</programlisting>
<para>
Private <link linkend="PkServicePack"><type>PkServicePack</type></link> data</para>
<para>
</para></refsect2>
<refsect2 id="PkServicePack-struct" role="struct">
<title>PkServicePack</title>
<indexterm zone="PkServicePack-struct"><primary sortas="PkServicePack">PkServicePack</primary></indexterm><programlisting>typedef struct _PkServicePack PkServicePack;</programlisting>
<para>
</para></refsect2>
<refsect2 id="pk-service-pack-error-quark" role="function">
<title>pk_service_pack_error_quark ()</title>
<indexterm zone="pk-service-pack-error-quark"><primary sortas="pk_service_pack_error_quark">pk_service_pack_error_quark</primary></indexterm><programlisting><link linkend="GQuark">GQuark</link>              pk_service_pack_error_quark         (void);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Our personal error quark.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-get-type" role="function">
<title>pk_service_pack_get_type ()</title>
<indexterm zone="pk-service-pack-get-type"><primary sortas="pk_service_pack_get_type">pk_service_pack_get_type</primary></indexterm><programlisting><link linkend="GType">GType</link>               pk_service_pack_get_type            (void);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-new" role="function">
<title>pk_service_pack_new ()</title>
<indexterm zone="pk-service-pack-new"><primary sortas="pk_service_pack_new">pk_service_pack_new</primary></indexterm><programlisting><link linkend="PkServicePack">PkServicePack</link> *     pk_service_pack_new                 (void);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A new service_pack class instance.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-test" role="function">
<title>pk_service_pack_test ()</title>
<indexterm zone="pk-service-pack-test"><primary sortas="pk_service_pack_test">pk_service_pack_test</primary></indexterm><programlisting><link linkend="void">void</link>                pk_service_pack_test                (<link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-check-valid" role="function">
<title>pk_service_pack_check_valid ()</title>
<indexterm zone="pk-service-pack-check-valid"><primary sortas="pk_service_pack_check_valid">pk_service_pack_check_valid</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pk_service_pack_check_valid         (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Checks to see if a service pack file is valid, and usable with this system.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pack</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkServicePack"><type>PkServicePack</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the filename of the pack to check
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><literal>GError</literal></link> to put the error code and message in, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the service pack is valid
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-set-temp-directory" role="function">
<title>pk_service_pack_set_temp_directory ()</title>
<indexterm zone="pk-service-pack-set-temp-directory"><primary sortas="pk_service_pack_set_temp_directory">pk_service_pack_set_temp_directory</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pk_service_pack_set_temp_directory  (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *directory);</programlisting>
<para>
Sets the directory to use when decompressing the service pack</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pack</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkServicePack"><type>PkServicePack</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>directory</parameter>&#160;:</term>
<listitem><simpara> the directory to use, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to use the default
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the directory was set
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-generic-finish" role="function">
<title>pk_service_pack_generic_finish ()</title>
<indexterm zone="pk-service-pack-generic-finish"><primary sortas="pk_service_pack_generic_finish">pk_service_pack_generic_finish</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            pk_service_pack_generic_finish      (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *res,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Gets the result from the asynchronous function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pack</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkServicePack"><type>PkServicePack</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>res</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GAsyncResult"><type>GAsyncResult</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GError"><type>GError</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> for success
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-create-for-package-ids-async" role="function">
<title>pk_service_pack_create_for_package_ids_async ()</title>
<indexterm zone="pk-service-pack-create-for-package-ids-async"><primary sortas="pk_service_pack_create_for_package_ids_async">pk_service_pack_create_for_package_ids_async</primary></indexterm><programlisting><link linkend="void">void</link>                pk_service_pack_create_for_package_ids_async
                                                        (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="gchar">gchar</link> **package_ids_exclude,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Create a service pack for the specified Package IDs</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pack</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkServicePack"><type>PkServicePack</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the filename of the service pack
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>package_ids</parameter>&#160;:</term>
<listitem><simpara> a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>package_ids_exclude</parameter>&#160;:</term>
<listitem><simpara> An array of packages to exclude, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GCancellable"><type>GCancellable</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>progress_callback</parameter>&#160;:</term>
<listitem><simpara> the function to run when the progress changes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>progress_user_data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>progress_callback</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> the function to run on completion
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> the data to pass to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-service-pack-create-for-updates-async" role="function">
<title>pk_service_pack_create_for_updates_async ()</title>
<indexterm zone="pk-service-pack-create-for-updates-async"><primary sortas="pk_service_pack_create_for_updates_async">pk_service_pack_create_for_updates_async</primary></indexterm><programlisting><link linkend="void">void</link>                pk_service_pack_create_for_updates_async
                                                        (<link linkend="PkServicePack">PkServicePack</link> *pack,
                                                         const <link linkend="gchar">gchar</link> *filename,
                                                         <link linkend="gchar">gchar</link> **package_ids_exclude,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Create a service pack for the specified Package IDs</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pack</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkServicePack"><type>PkServicePack</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the filename of the service pack
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>package_ids_exclude</parameter>&#160;:</term>
<listitem><simpara> An array of packages to exclude, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GCancellable"><type>GCancellable</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>progress_callback</parameter>&#160;:</term>
<listitem><simpara> the function to run when the progress changes
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>progress_user_data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>progress_callback</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> the function to run on completion
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> the data to pass to <parameter>callback</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
