PkTask: PackageKit Reference Manual

## PkTask PkTask — An abstract package task GObject, dealing with unsigned transactions, GPG keys and EULA requests. |

## Functions

PkTask * | pk_task_new ()
PkResults * | pk_task_generic_finish ()
PkResults * | pk_task_install_packages_sync ()
void | pk_task_install_packages_async ()
PkResults * | pk_task_update_packages_sync ()
void | pk_task_update_packages_async ()
PkResults * | pk_task_remove_packages_sync ()
void | pk_task_remove_packages_async ()
PkResults * | pk_task_install_files_sync ()
void | pk_task_install_files_async ()
PkResults * | pk_task_resolve_sync ()
void | pk_task_resolve_async ()
PkResults * | pk_task_search_names_sync ()
void | pk_task_search_names_async ()
PkResults * | pk_task_search_details_sync ()
void | pk_task_search_details_async ()
PkResults * | pk_task_search_groups_sync ()
void | pk_task_search_groups_async ()
PkResults * | pk_task_search_files_sync ()
void | pk_task_search_files_async ()
PkResults * | pk_task_get_details_sync ()
void | pk_task_get_details_async ()
PkResults * | pk_task_get_update_detail_sync ()
void | pk_task_get_update_detail_async ()
PkResults * | pk_task_download_packages_sync ()
void | pk_task_download_packages_async ()
PkResults * | pk_task_get_updates_sync ()
void | pk_task_get_updates_async ()
PkResults * | pk_task_depends_on_sync ()
void | pk_task_depends_on_async ()
PkResults * | pk_task_get_packages_sync ()
void | pk_task_get_packages_async ()
PkResults * | pk_task_required_by_sync ()
void | pk_task_required_by_async ()
PkResults * | pk_task_what_provides_sync ()
void | pk_task_what_provides_async ()
PkResults * | pk_task_get_files_sync ()
void | pk_task_get_files_async ()
PkResults * | pk_task_get_categories_sync ()
void | pk_task_get_categories_async ()
PkResults * | pk_task_refresh_cache_sync ()
void | pk_task_refresh_cache_async ()
PkResults * | pk_task_get_repo_list_sync ()
void | pk_task_get_repo_list_async ()
PkResults * | pk_task_repo_enable_sync ()
void | pk_task_repo_enable_async ()
PkResults * | pk_task_upgrade_system_sync ()
void | pk_task_upgrade_system_async ()
PkResults * | pk_task_repair_system_sync ()
void | pk_task_repair_system_async ()
gboolean | pk_task_user_accepted ()
gboolean | pk_task_user_declined ()
void | pk_task_set_simulate ()
gboolean | pk_task_get_simulate ()
void | pk_task_set_only_download ()
gboolean | pk_task_get_only_download ()
void | pk_task_set_allow_downgrade ()
gboolean | pk_task_get_allow_downgrade ()
void | pk_task_set_allow_reinstall ()
gboolean | pk_task_get_allow_reinstall ()
void | pk_task_set_only_trusted ()
gboolean | pk_task_get_only_trusted ()

## Types and Values

#define | PK_TASK_TYPE_ERROR

## Description

## Functions

### pk_task_new ()

    PkTask *
    pk_task_new (void);

#### Returns

a new PkTask object.

Since: 0.5.2

### pk_task_generic_finish ()

    PkResults *
    pk_task_generic_finish (PkTask *task,
                            GAsyncResult *res,
                            GError **error);

Gets the result from the asynchronous function.

#### Parameters

task | a valid PkTask instance |
res | the GAsyncResult |
error | A GError or `NULL` |

#### Returns

The PkResults of the transaction.

[transfer full]

Since: 0.5.2

### pk_task_install_packages_sync ()

    PkResults *
    pk_task_install_packages_sync (PkTask *task,
                                   gchar **package_ids,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GError **error);

Install a package of the newest and most correct version.

Warning: this function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.5.3

### pk_task_install_packages_async ()

    void
    pk_task_install_packages_async (PkTask *task,
                                    gchar **package_ids,
                                    GCancellable *cancellable,
                                    PkProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GAsyncReadyCallback callback_ready,
                                    gpointer user_data);

Merges in details about packages using resolve.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.5.2

### pk_task_update_packages_sync ()

    PkResults *
    pk_task_update_packages_sync (PkTask *task,
                                  gchar **package_ids,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GError **error);

Update specific packages to the newest available versions.

Warning: this function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.5.3

### pk_task_update_packages_async ()

    void
    pk_task_update_packages_async (PkTask *task,
                                   gchar **package_ids,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

Update specific packages to the newest available versions.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since: 0.5.2

### pk_task_remove_packages_sync ()

    PkResults *
    pk_task_remove_packages_sync (PkTask *task,
                                  gchar **package_ids,
                                  gboolean allow_deps,
                                  gboolean autoremove,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GError **error);

Remove a package (optionally with dependancies) from the system. If `allow_deps` is set to `FALSE`, and other packages would have to be removed, then the transaction would fail.

Warning: this function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
allow_deps | if other dependent packages are allowed to be removed from the computer |
autoremove | if other packages installed at the same time should be tried to remove |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.5.3

### pk_task_remove_packages_async ()

    void
    pk_task_remove_packages_async (PkTask *task,
                                   gchar **package_ids,
                                   gboolean allow_deps,
                                   gboolean autoremove,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

Remove a package (optionally with dependancies) from the system. If `allow_deps` is set to `FALSE`, and other packages would have to be removed, then the transaction would fail.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
allow_deps | if other dependent packages are allowed to be removed from the computer |
autoremove | if other packages installed at the same time should be tried to remove |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since: 0.5.2

### pk_task_install_files_sync ()

    PkResults *
    pk_task_install_files_sync (PkTask *task,
                                gchar **files,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GError **error);

Install a file locally, and get the deps from the repositories. This is useful for double clicking on a .rpm or .deb file.

Warning: this function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

task | a valid PkTask instance |
files | a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.5.3

### pk_task_install_files_async ()

    void
    pk_task_install_files_async (PkTask *task,
                                 gchar **files,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Install a file locally, and get the deps from the repositories. This is useful for double clicking on a .rpm or .deb file.

#### Parameters

task | a valid PkTask instance |
files | a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since: 0.5.2

### pk_task_resolve_sync ()

    PkResults *
    pk_task_resolve_sync (PkTask *task,
                          PkBitfield filters,
                          gchar **packages,
                          GCancellable *cancellable,
                          PkProgressCallback progress_callback,
                          gpointer progress_user_data,
                          GError **error);

Resolves a package name to a package-id.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
packages | package names to find. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_resolve_async ()

    void
    pk_task_resolve_async (PkTask *task,
                           PkBitfield filters,
                           gchar **packages,
                           GCancellable *cancellable,
                           PkProgressCallback progress_callback,
                           gpointer progress_user_data,
                           GAsyncReadyCallback callback_ready,
                           gpointer user_data);

Resolves a package name to a package-id.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
packages | package names to find. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_search_names_sync ()

    PkResults *
    pk_task_search_names_sync (PkTask *task,
                               PkBitfield filters,
                               gchar **values,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GError **error);

Searches for a package name.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_search_names_async ()

    void
    pk_task_search_names_async (PkTask *task,
                                PkBitfield filters,
                                gchar **values,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GAsyncReadyCallback callback_ready,
                                gpointer user_data);

Searches for a package name.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_search_details_sync ()

    PkResults *
    pk_task_search_details_sync (PkTask *task,
                                 PkBitfield filters,
                                 gchar **values,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GError **error);

Searches for some package details.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_search_details_async ()

    void
    pk_task_search_details_async (PkTask *task,
                                  PkBitfield filters,
                                  gchar **values,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Searches for some package details.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_search_groups_sync ()

    PkResults *
    pk_task_search_groups_sync (PkTask *task,
                                PkBitfield filters,
                                gchar **values,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GError **error);

Searches the group lists.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_search_groups_async ()

    void
    pk_task_search_groups_async (PkTask *task,
                                 PkBitfield filters,
                                 gchar **values,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Searches the group lists.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_search_files_sync ()

    PkResults *
    pk_task_search_files_sync (PkTask *task,
                               PkBitfield filters,
                               gchar **values,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GError **error);

Searches for specific files.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_search_files_async ()

    void
    pk_task_search_files_async (PkTask *task,
                                PkBitfield filters,
                                gchar **values,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GAsyncReadyCallback callback_ready,
                                gpointer user_data);

Searches for specific files.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | search values. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_details_sync ()

    PkResults *
    pk_task_get_details_sync (PkTask *task,
                              gchar **package_ids,
                              GCancellable *cancellable,
                              PkProgressCallback progress_callback,
                              gpointer progress_user_data,
                              GError **error);

Gets details about packages.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_details_async ()

    void
    pk_task_get_details_async (PkTask *task,
                               gchar **package_ids,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GAsyncReadyCallback callback_ready,
                               gpointer user_data);

Gets details about packages.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_update_detail_sync ()

    PkResults *
    pk_task_get_update_detail_sync (PkTask *task,
                                    gchar **package_ids,
                                    GCancellable *cancellable,
                                    PkProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GError **error);

Gets details about updates.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_update_detail_async ()

    void
    pk_task_get_update_detail_async (PkTask *task,
                                     gchar **package_ids,
                                     GCancellable *cancellable,
                                     PkProgressCallback progress_callback,
                                     gpointer progress_user_data,
                                     GAsyncReadyCallback callback_ready,
                                     gpointer user_data);

Gets details about updates.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_download_packages_sync ()

    PkResults *
    pk_task_download_packages_sync (PkTask *task,
                                    gchar **package_ids,
                                    const gchar *directory,
                                    GCancellable *cancellable,
                                    PkProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GError **error);

Downloads packages

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
directory | the destination directory |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_download_packages_async ()

    void
    pk_task_download_packages_async (PkTask *task,
                                     gchar **package_ids,
                                     const gchar *directory,
                                     GCancellable *cancellable,
                                     PkProgressCallback progress_callback,
                                     gpointer progress_user_data,
                                     GAsyncReadyCallback callback_ready,
                                     gpointer user_data);

Downloads packages

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
directory | the destination directory |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_updates_sync ()

    PkResults *
    pk_task_get_updates_sync (PkTask *task,
                              PkBitfield filters,
                              GCancellable *cancellable,
                              PkProgressCallback progress_callback,
                              gpointer progress_user_data,
                              GError **error);

Gets the update lists.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_updates_async ()

    void
    pk_task_get_updates_async (PkTask *task,
                               PkBitfield filters,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GAsyncReadyCallback callback_ready,
                               gpointer user_data);

Gets the update lists.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_depends_on_sync ()

    PkResults *
    pk_task_depends_on_sync (PkTask *task,
                             PkBitfield filters,
                             gchar **package_ids,
                             gboolean recursive,
                             GCancellable *cancellable,
                             PkProgressCallback progress_callback,
                             gpointer progress_user_data,
                             GError **error);

Get the list of dependent packages.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
recursive | if we should recurse to packages that depend on other packages |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_depends_on_async ()

    void
    pk_task_depends_on_async (PkTask *task,
                              PkBitfield filters,
                              gchar **package_ids,
                              gboolean recursive,
                              GCancellable *cancellable,
                              PkProgressCallback progress_callback,
                              gpointer progress_user_data,
                              GAsyncReadyCallback callback_ready,
                              gpointer user_data);

Get the list of dependant packages.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
recursive | if we should recurse to packages that depend on other packages |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_packages_sync ()

    PkResults *
    pk_task_get_packages_sync (PkTask *task,
                               PkBitfield filters,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GError **error);

Gets the list of packages.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_packages_async ()

    void
    pk_task_get_packages_async (PkTask *task,
                                PkBitfield filters,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GAsyncReadyCallback callback_ready,
                                gpointer user_data);

Gets the list of packages.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_required_by_sync ()

    PkResults *
    pk_task_required_by_sync (PkTask *task,
                              PkBitfield filters,
                              gchar **package_ids,
                              gboolean recursive,
                              GCancellable *cancellable,
                              PkProgressCallback progress_callback,
                              gpointer progress_user_data,
                              GError **error);

Get the packages this package requires.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
recursive | if we should return packages that depend on the ones we do |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_required_by_async ()

    void
    pk_task_required_by_async (PkTask *task,
                               PkBitfield filters,
                               gchar **package_ids,
                               gboolean recursive,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GAsyncReadyCallback callback_ready,
                               gpointer user_data);

Get the packages this package requires.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
recursive | if we should return packages that depend on the ones we do |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_what_provides_sync ()

    PkResults *
    pk_task_what_provides_sync (PkTask *task,
                                PkBitfield filters,
                                gchar **values,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GError **error);

Find the package that provides some resource.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | values to search for. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_what_provides_async ()

    void
    pk_task_what_provides_async (PkTask *task,
                                 PkBitfield filters,
                                 gchar **values,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Find the package that provides some resource.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
values | values to search for. | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_files_sync ()

    PkResults *
    pk_task_get_files_sync (PkTask *task,
                            gchar **package_ids,
                            GCancellable *cancellable,
                            PkProgressCallback progress_callback,
                            gpointer progress_user_data,
                            GError **error);

Get the files in a package.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_files_async ()

    void
    pk_task_get_files_async (PkTask *task,
                             gchar **package_ids,
                             GCancellable *cancellable,
                             PkProgressCallback progress_callback,
                             gpointer progress_user_data,
                             GAsyncReadyCallback callback_ready,
                             gpointer user_data);

Get the files in a package.

#### Parameters

task | a valid PkTask instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_categories_sync ()

    PkResults *
    pk_task_get_categories_sync (PkTask *task,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GError **error);

Get the categories available.

#### Parameters

task | a valid PkTask instance |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_categories_async ()

    void
    pk_task_get_categories_async (PkTask *task,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Get the categories available.

#### Parameters

task | a valid PkTask instance |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion. | [scope async]
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_refresh_cache_sync ()

    PkResults *
    pk_task_refresh_cache_sync (PkTask *task,
                                gboolean force,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GError **error);

Refresh the package cache.

#### Parameters

task | a valid PkTask instance |
force | if the metadata should be deleted and re-downloaded even if it is correct |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_refresh_cache_async ()

    void
    pk_task_refresh_cache_async (PkTask *task,
                                 gboolean force,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Refresh the package cache.

#### Parameters

task | a valid PkTask instance |
force | if the metadata should be deleted and re-downloaded even if it is correct |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_get_repo_list_sync ()

    PkResults *
    pk_task_get_repo_list_sync (PkTask *task,
                                PkBitfield filters,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GError **error);

Get the list of available repositories.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_get_repo_list_async ()

    void
    pk_task_get_repo_list_async (PkTask *task,
                                 PkBitfield filters,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Get the list of available repositories.

#### Parameters

task | a valid PkTask instance |
filters | a bitfield of filters that can be used to limit the results |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_repo_enable_sync ()

    PkResults *
    pk_task_repo_enable_sync (PkTask *task,
                              const gchar *repo_id,
                              gboolean enabled,
                              GCancellable *cancellable,
                              PkProgressCallback progress_callback,
                              gpointer progress_user_data,
                              GError **error);

Enable or disable a specific repo.

#### Parameters

task | a valid PkTask instance |
repo_id | The software repository ID |
enabled | `TRUE` or `FALSE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.6.5

### pk_task_repo_enable_async ()

    void
    pk_task_repo_enable_async (PkTask *task,
                               const gchar *repo_id,
                               gboolean enabled,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GAsyncReadyCallback callback_ready,
                               gpointer user_data);

Enable or disable a specific repo.

#### Parameters

task | a valid PkTask instance |
repo_id | The software repository ID |
enabled | `TRUE` or `FALSE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 0.6.5

### pk_task_upgrade_system_sync ()

    PkResults *
    pk_task_upgrade_system_sync (PkTask *task,
                                 const gchar *distro_id,
                                 PkUpgradeKindEnum upgrade_kind,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GError **error);

This transaction will update the distro to the next version, which may involve just downloading the installer and setting up the boot device, or may involve doing an on-line upgrade.

The backend will decide what is best to do.

#### Parameters

task | a valid PkTask instance |
distro_id | a distro ID such as "fedora-14" |
upgrade_kind | a PkUpgradeKindEnum such as `PK_UPGRADE_KIND_ENUM_COMPLETE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 1.0.12

### pk_task_upgrade_system_async ()

    void
    pk_task_upgrade_system_async (PkTask *task,
                                  const gchar *distro_id,
                                  PkUpgradeKindEnum upgrade_kind,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

This transaction will update the distro to the next version, which may involve just downloading the installer and setting up the boot device, or may involve doing an on-line upgrade.

The backend will decide what is best to do.

#### Parameters

task | a valid PkTask instance |
distro_id | a distro ID such as "fedora-14" |
upgrade_kind | a PkUpgradeKindEnum such as `PK_UPGRADE_KIND_ENUM_COMPLETE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since: 1.0.12

### pk_task_repair_system_sync ()

    PkResults *
    pk_task_repair_system_sync (PkTask *task,
                                GCancellable *cancellable,
                                PkProgressCallback progress_callback,
                                gpointer progress_user_data,
                                GError **error);

Recover from broken dependencies of installed packages or incomplete installations.

Warning: this function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

task | a valid PkTask instance |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
error | the GError to store any failure, or `NULL` |

#### Returns

a PkResults object, or `NULL` for error.

[transfer full]

Since: 0.7.2

### pk_task_repair_system_async ()

    void
    pk_task_repair_system_async (PkTask *task,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Recover the system from broken dependencies and aborted installations.

#### Parameters

task | a valid PkTask instance |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope notified]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since: 0.7.2

### pk_task_user_accepted ()

    gboolean
    pk_task_user_accepted (PkTask *task,
                           guint request);

Mark a EULA as accepted by the user.

#### Parameters

task | a valid PkTask instance |
request | request ID for EULA. |

#### Returns

`TRUE` if `request` is valid.

Since: 0.5.2

### pk_task_user_declined ()

    gboolean
    pk_task_user_declined (PkTask *task,
                           guint request);

Mark a EULA as declined by the user.

#### Parameters

task | a valid PkTask instance |
request | request ID for EULA. |

#### Returns

`TRUE` if `request` is valid.

Since: 0.5.2

### pk_task_set_simulate ()

    void
    pk_task_set_simulate (PkTask *task,
                          gboolean simulate);

If the simulate step should be run without the actual transaction.

#### Parameters

task | a valid PkTask instance |
simulate | the simulate mode |

Since: 0.6.10

### pk_task_get_simulate ()

    gboolean
    pk_task_get_simulate (PkTask *task);

Gets if we are simulating.

#### Parameters

task | a valid PkTask instance |

#### Returns

`TRUE` if we are simulating

Since: 0.6.10

### pk_task_set_only_download ()

    void
    pk_task_set_only_download (PkTask *task,
                               gboolean only_download);

If the transaction should be prepared (depsolved, packages downloaded, etc) but not committed.

#### Parameters

task | a valid PkTask instance |
only_download | `FALSE` to actually commit the transaction |

Since: 0.8.1

### pk_task_get_only_download ()

    gboolean
    pk_task_get_only_download (PkTask *task);

Gets if we are just preparing the transaction for later.

#### Parameters

task | a valid PkTask instance |

#### Returns

`TRUE` if only downloading

Since: 0.8.1

### pk_task_set_allow_downgrade ()

    void
    pk_task_set_allow_downgrade (PkTask *task,
                                 gboolean allow_downgrade);

If package downgrades shall be allowed during transaction.

#### Parameters

task | a valid PkTask instance |
allow_downgrade | `TRUE` to allow packages to be downgraded. |

Since: 1.0.2

### pk_task_get_allow_downgrade ()

    gboolean
    pk_task_get_allow_downgrade (PkTask *task);

Gets if we are allow packages to be downgraded.

#### Parameters

task | a valid PkTask instance |

#### Returns

`TRUE` if package downgrades are allowed

Since: 1.0.2

### pk_task_set_allow_reinstall ()

    void
    pk_task_set_allow_reinstall (PkTask *task,
                                 gboolean allow_reinstall);

If package reinstallation shall be allowed during transaction.

#### Parameters

task | a valid PkTask instance |
allow_reinstall | `TRUE` to allow packages to be reinstalled. |

Since: 1.0.2

### pk_task_get_allow_reinstall ()

    gboolean
    pk_task_get_allow_reinstall (PkTask *task);

Gets if we allow packages to be reinstalled.

#### Parameters

task | a valid PkTask instance |

#### Returns

`TRUE` if package reinstallation is allowed

Since: 1.0.2

### pk_task_set_only_trusted ()

    void
    pk_task_set_only_trusted (PkTask *task,
                              gboolean only_trusted);

If only authenticated packages should be allowed in the transaction.

#### Parameters

task | a valid PkTask instance |
only_trusted | `TRUE` to allow only authenticated packages |

Since: 0.9.5

### pk_task_get_only_trusted ()

    gboolean
    pk_task_get_only_trusted (PkTask *task);

Gets if we allow only authenticated packages in the transactoin.

#### Parameters

task | a valid PkTask instance |

#### Returns

`TRUE` if we allow only authenticated packages

Since: 0.9.5

## Types and Values

### PK_TASK_TYPE_ERROR

    #define PK_TASK_TYPE_ERROR (pk_task_error_get_type ())