pk-service-pack
3
PACKAGEKIT Library

# pk-service-pack

## Synopsis

    #define             PK_SERVICE_PACK_ERROR
    #define             PK_SERVICE_PACK_TYPE_ERROR
    typedef             PkServicePackPrivate;
    enum                PkServicePackError;
    enum                PkServicePackStatus;
    void                package                             (PkServicePack *pack,
                                                             const PkPackageObj *obj);
    void                percentage                          (PkServicePack *pack,
                                                             guint percentage);
    void                status                              (PkServicePack *pack,
                                                             PkServicePackStatus status);
    GQuark              pk_service_pack_error_quark         (void);
    GType               pk_service_pack_get_type            (void);
    PkServicePack *     pk_service_pack_new                 (void);
    gboolean            pk_service_pack_check_valid         (PkServicePack *pack,
                                                             GError **error);
    gboolean            pk_service_pack_set_filename        (PkServicePack *pack,
                                                             const gchar *filename);
    gboolean            pk_service_pack_set_temp_directory  (PkServicePack *pack,
                                                             const gchar *directory);
    gboolean            pk_service_pack_set_exclude_list    (PkServicePack *pack,
                                                             PkPackageList *list);
    gboolean            pk_service_pack_create_for_package_id
                                                            (PkServicePack *pack,
                                                             const gchar *package_id,
                                                             GError **error);
    gboolean            pk_service_pack_create_for_package_ids
                                                            (PkServicePack *pack,
                                                             gchar **package_ids,
                                                             GError **error);
    gboolean            pk_service_pack_create_for_updates  (PkServicePack *pack,
                                                             GError **error);
    gboolean            pk_service_pack_cancel              (PkServicePack *pack,
                                                             GError **error);

## Description

## 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 ())

### PkServicePackPrivate

    typedef struct PkServicePackPrivate PkServicePackPrivate;

### 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;

### enum PkServicePackStatus

    typedef enum
    {
    	PK_SERVICE_PACK_STATUS_DOWNLOAD_PACKAGES,
    	PK_SERVICE_PACK_STATUS_DOWNLOAD_DEPENDENCIES,
    	PK_SERVICE_PACK_STATUS_UNKNOWN
    } PkServicePackStatus;

### package ()

    void                package                             (PkServicePack *pack,
                                                             const PkPackageObj *obj);

`pack` :

`obj` :

### percentage ()

    void                percentage                          (PkServicePack *pack,
                                                             guint percentage);

`pack` :

`percentage` :

### status ()

    void                status                              (PkServicePack *pack,
                                                             PkServicePackStatus status);

`pack` :

`status` :

### pk_service_pack_error_quark ()

    GQuark              pk_service_pack_error_quark         (void);

Returns :

  Our personal error quark.

### pk_service_pack_get_type ()

    GType               pk_service_pack_get_type            (void);

Returns :

### pk_service_pack_new ()

    PkServicePack *     pk_service_pack_new                 (void);

Returns :

  A new service_pack class instance.

### pk_service_pack_check_valid ()

    gboolean            pk_service_pack_check_valid         (PkServicePack *pack,
                                                             GError **error);

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

`pack` :

  a valid PkServicePack instance

`error` :

  a `GError` to put the error code and message in, or `NULL`

Returns :

  `TRUE` if the service pack is valid

### pk_service_pack_set_filename ()

    gboolean            pk_service_pack_set_filename        (PkServicePack *pack,
                                                             const gchar *filename);

Sets the filename to use when reading or writing a service pack

`pack` :

  a valid PkServicePack instance

`filename` :

  the filename to use

Returns :

  `TRUE` if the name was set

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

### pk_service_pack_set_exclude_list ()

    gboolean            pk_service_pack_set_exclude_list    (PkServicePack *pack,
                                                             PkPackageList *list);

Sets the list of packages to exclude from the dependency downloads.

`pack` :

  a valid PkServicePack instance

`list` :

  the list of packages to exclude

Returns :

  `TRUE` if the list was set

### pk_service_pack_create_for_package_id ()

    gboolean            pk_service_pack_create_for_package_id
                                                            (PkServicePack *pack,
                                                             const gchar *package_id,
                                                             GError **error);

Adds the package specified to a service pack.

`pack` :

  a valid PkServicePack instance

`package_id` :

  A single package_id to download

`error` :

  a `GError` to put the error code and message in, or `NULL`

Returns :

  `TRUE` if the service pack was created successfully

### pk_service_pack_create_for_package_ids ()

    gboolean            pk_service_pack_create_for_package_ids
                                                            (PkServicePack *pack,
                                                             gchar **package_ids,
                                                             GError **error);

Adds the packages specified to a service pack.

`pack` :

  a valid PkServicePack instance

`package_ids` :

  A list of package_ids to download

`error` :

  a `GError` to put the error code and message in, or `NULL`

Returns :

  `TRUE` if the service pack was created successfully

### pk_service_pack_create_for_updates ()

    gboolean            pk_service_pack_create_for_updates  (PkServicePack *pack,
                                                             GError **error);

Adds any pending updates to a service pack.

`pack` :

  a valid PkServicePack instance

`error` :

  a `GError` to put the error code and message in, or `NULL`

Returns :

  `TRUE` if the service pack was created successfully

### pk_service_pack_cancel ()

    gboolean            pk_service_pack_cancel              (PkServicePack *pack,
                                                             GError **error);

Cancels the pack creation

`pack` :

  a valid PkServicePack instance

`error` :

  a `GError` to put the error code and message in, or `NULL`

Returns :

  `TRUE` if we cancelled okay