PkServicePack

## PkServicePack PkServicePack — Functionality for creating and reading service packs |

## Synopsis

    #define             PK_SERVICE_PACK_ERROR
    #define             PK_SERVICE_PACK_TYPE_ERROR
    #define             PK_SERVICE_PACK_FILE_EXTENSION
    enum                PkServicePackError;
    struct              PkServicePack;
    struct              PkServicePackClass;
    GQuark              pk_service_pack_error_quark         (void);
    PkServicePack *     pk_service_pack_new                 (void);
    void                pk_service_pack_test                (gpointer user_data);
    gboolean            pk_service_pack_check_valid         (PkServicePack *pack,
                                                             const gchar *filename,
                                                             GError **error);
    gboolean            pk_service_pack_set_temp_directory  (PkServicePack *pack,
                                                             const gchar *directory);
    gboolean            pk_service_pack_generic_finish      (PkServicePack *pack,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                pk_service_pack_create_for_package_ids_async
                                                            (PkServicePack *pack,
                                                             const gchar *filename,
                                                             gchar **package_ids,
                                                             gchar **package_ids_exclude,
                                                             GCancellable *cancellable,
                                                             PkProgressCallback progress_callback,
                                                             gpointer progress_user_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    void                pk_service_pack_create_for_updates_async
                                                            (PkServicePack *pack,
                                                             const gchar *filename,
                                                             gchar **package_ids_exclude,
                                                             GCancellable *cancellable,
                                                             PkProgressCallback progress_callback,
                                                             gpointer progress_user_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

## Object Hierarchy

      GEnum
       +----PkServicePackError

      GObject
       +----PkServicePack

## Description

Clients can use this GObject for reading and writing service packs.

## Details

### PK_SERVICE_PACK_ERROR

    #define PK_SERVICE_PACK_ERROR	 	(pk_service_pack_error_quark ())

### PK_SERVICE_PACK_TYPE_ERROR

    #define PK_SERVICE_PACK_TYPE_ERROR (pk_service_pack_error_get_type ())

### PK_SERVICE_PACK_FILE_EXTENSION

    #define PK_SERVICE_PACK_FILE_EXTENSION "servicepack"

### enum PkServicePackError

    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;

`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` |

### struct PkServicePack

    struct PkServicePack;

### struct PkServicePackClass

    struct PkServicePackClass {
    	GObjectClass parent_class;
    	/* Padding for future expansion */
    	void (*_pk_reserved1) (void);
    	void (*_pk_reserved2) (void);
    	void (*_pk_reserved3) (void);
    	void (*_pk_reserved4) (void);
    };

### pk_service_pack_error_quark ()

    GQuark              pk_service_pack_error_quark         (void);

Returns : | Our personal error quark.

Since 0.5.2

### pk_service_pack_new ()

    PkServicePack *     pk_service_pack_new                 (void);

Returns : | A new service_pack class instance.

Since 0.5.2

### pk_service_pack_test ()

    void                pk_service_pack_test                (gpointer user_data);

### pk_service_pack_check_valid ()

    gboolean            pk_service_pack_check_valid         (PkServicePack *pack,
                                                             const gchar *filename,
                                                             GError **error);

Checks to see if a service pack file is valid, and usable with this system.

`pack` : | a valid PkServicePack instance
`filename` : | the filename of the pack to check
`error` : | a `GError` to put the error code and message in, or `NULL`
Returns : | `TRUE` if the service pack is valid

Since 0.5.2

### pk_service_pack_set_temp_directory ()

    gboolean            pk_service_pack_set_temp_directory  (PkServicePack *pack,
                                                             const gchar *directory);

Sets the directory to use when decompressing the service pack

`pack` : | a valid PkServicePack instance
`directory` : | the directory to use, or `NULL` to use the default
Returns : | `TRUE` if the directory was set

Since 0.5.2

### pk_service_pack_generic_finish ()

    gboolean            pk_service_pack_generic_finish      (PkServicePack *pack,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`pack` : | a valid PkServicePack instance
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | `TRUE` for success

Since 0.5.2

### pk_service_pack_create_for_package_ids_async ()

    void                pk_service_pack_create_for_package_ids_async
                                                            (PkServicePack *pack,
                                                             const gchar *filename,
                                                             gchar **package_ids,
                                                             gchar **package_ids_exclude,
                                                             GCancellable *cancellable,
                                                             PkProgressCallback progress_callback,
                                                             gpointer progress_user_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Create a service pack for the specified Package IDs

`pack` : | a valid PkServicePack instance
`filename` : | the filename of the service pack
`package_ids` : | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
`package_ids_exclude` : | An array of packages to exclude, or `NULL`
`cancellable` : | a GCancellable or `NULL`
`callback` : | the function to run on completion
`progress_callback` : | the function to run when the progress changes. [scope call]
`progress_user_data` : | data to pass to `progress_callback`
`user_data` : | the data to pass to `callback`

Since 0.5.2

### pk_service_pack_create_for_updates_async ()

    void                pk_service_pack_create_for_updates_async
                                                            (PkServicePack *pack,
                                                             const gchar *filename,
                                                             gchar **package_ids_exclude,
                                                             GCancellable *cancellable,
                                                             PkProgressCallback progress_callback,
                                                             gpointer progress_user_data,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Create a service pack for the specified Package IDs

`pack` : | a valid PkServicePack instance
`filename` : | the filename of the service pack
`package_ids_exclude` : | An array of packages to exclude, or `NULL`
`cancellable` : | a GCancellable or `NULL`
`callback` : | the function to run on completion
`progress_callback` : | the function to run when the progress changes. [scope call]
`progress_user_data` : | data to pass to `progress_callback`
`user_data` : | the data to pass to `callback`

Since 0.5.2