<?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="PackageKit-pk-task-sync">
<refmeta>
<refentrytitle role="top_of_page" id="PackageKit-pk-task-sync.top_of_page">pk-task-sync</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PACKAGEKIT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>pk-task-sync</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="PackageKit-pk-task-sync.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
<link linkend="PkResults">PkResults</link> *         <link linkend="pk-task-remove-packages-sync">pk_task_remove_packages_sync</link>        (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="gboolean">gboolean</link> allow_deps,
                                                         <link linkend="gboolean">gboolean</link> autoremove,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="PkResults">PkResults</link> *         <link linkend="pk-task-install-packages-sync">pk_task_install_packages_sync</link>       (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="PkResults">PkResults</link> *         <link linkend="pk-task-update-packages-sync">pk_task_update_packages_sync</link>        (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="PkResults">PkResults</link> *         <link linkend="pk-task-install-files-sync">pk_task_install_files_sync</link>          (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **files,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="PkResults">PkResults</link> *         <link linkend="pk-task-update-system-sync">pk_task_update_system_sync</link>          (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);
</synopsis>
</refsynopsisdiv>









<refsect1 id="PackageKit-pk-task-sync.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="PackageKit-pk-task-sync.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="pk-task-remove-packages-sync" role="function">
<title>pk_task_remove_packages_sync ()</title>
<indexterm zone="pk-task-remove-packages-sync"><primary sortas="pk_task_remove_packages_sync">pk_task_remove_packages_sync</primary></indexterm><programlisting><link linkend="PkResults">PkResults</link> *         pk_task_remove_packages_sync        (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="gboolean">gboolean</link> allow_deps,
                                                         <link linkend="gboolean">gboolean</link> autoremove,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Remove a package (optionally with dependancies) from the system.
If <link linkend="allow-deps"><literal>allow_deps</literal></link> is set to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, and other packages would have to be removed,
then the transaction would fail.
</para>
<para>
Warning: this function is synchronous, and may block. Do not use it in GUI
applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>task</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkTask"><type>PkTask</type></link> instance
</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>allow_deps</parameter>&#160;:</term>
<listitem><simpara> if other dependant packages are allowed to be removed from the computer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>autoremove</parameter>&#160;:</term>
<listitem><simpara> if other packages installed at the same time should be tried to remove
</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>error</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GError"><type>GError</type></link> to store any failure, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="PkResults"><literal>PkResults</literal></link> object, or NULL for error
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-task-install-packages-sync" role="function">
<title>pk_task_install_packages_sync ()</title>
<indexterm zone="pk-task-install-packages-sync"><primary sortas="pk_task_install_packages_sync">pk_task_install_packages_sync</primary></indexterm><programlisting><link linkend="PkResults">PkResults</link> *         pk_task_install_packages_sync       (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Install a package of the newest and most correct version.
</para>
<para>
Warning: this function is synchronous, and may block. Do not use it in GUI
applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>task</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkTask"><type>PkTask</type></link> instance
</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>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>error</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GError"><type>GError</type></link> to store any failure, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="PkResults"><literal>PkResults</literal></link> object, or NULL for error
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-task-update-packages-sync" role="function">
<title>pk_task_update_packages_sync ()</title>
<indexterm zone="pk-task-update-packages-sync"><primary sortas="pk_task_update_packages_sync">pk_task_update_packages_sync</primary></indexterm><programlisting><link linkend="PkResults">PkResults</link> *         pk_task_update_packages_sync        (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **package_ids,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Update specific packages to the newest available versions.
</para>
<para>
Warning: this function is synchronous, and may block. Do not use it in GUI
applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>task</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkTask"><type>PkTask</type></link> instance
</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>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>error</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GError"><type>GError</type></link> to store any failure, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="PkResults"><literal>PkResults</literal></link> object, or NULL for error
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-task-install-files-sync" role="function">
<title>pk_task_install_files_sync ()</title>
<indexterm zone="pk-task-install-files-sync"><primary sortas="pk_task_install_files_sync">pk_task_install_files_sync</primary></indexterm><programlisting><link linkend="PkResults">PkResults</link> *         pk_task_install_files_sync          (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="gchar">gchar</link> **files,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Install a file locally, and get the deps from the repositories.
This is useful for double clicking on a .rpm or .deb file.
</para>
<para>
Warning: this function is synchronous, and may block. Do not use it in GUI
applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>task</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkTask"><type>PkTask</type></link> instance
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>files</parameter>&#160;:</term>
<listitem><simpara> a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm"
</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>error</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GError"><type>GError</type></link> to store any failure, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="PkResults"><literal>PkResults</literal></link> object, or NULL for error
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="pk-task-update-system-sync" role="function">
<title>pk_task_update_system_sync ()</title>
<indexterm zone="pk-task-update-system-sync"><primary sortas="pk_task_update_system_sync">pk_task_update_system_sync</primary></indexterm><programlisting><link linkend="PkResults">PkResults</link> *         pk_task_update_system_sync          (<link linkend="PkTask">PkTask</link> *task,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="PkProgressCallback">PkProgressCallback</link> progress_callback,
                                                         <link linkend="gpointer">gpointer</link> progress_user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Update all the packages on the system with the highest versions found in all
repositories.
NOTE: you can't choose what repositories to update from, but you can do:
- <link linkend="pk-task-repo-disable"><function>pk_task_repo_disable()</function></link>
- <link linkend="pk-task-update-system"><function>pk_task_update_system()</function></link>
- <link linkend="pk-task-repo-enable"><function>pk_task_repo_enable()</function></link>
</para>
<para>
Warning: this function is synchronous, and may block. Do not use it in GUI
applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>task</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="PkTask"><type>PkTask</type></link> instance
</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>error</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GError"><type>GError</type></link> to store any failure, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="PkResults"><literal>PkResults</literal></link> object, or NULL for error
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
