[packagekit] Allowing multiple actions in a transaction

Richard Hughes hughsient at gmail.com
Sun Mar 9 13:03:29 PDT 2008


We've talked in the past about enabling the ticky boxes in
pk-up-date-viewer quite a bit. We also need plural updates for things
like "only update security packages" and other reasons.

What we have now:

    <method name="GetFiles">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg type="s" name="tid" direction="in"/>
      <arg type="s" name="package_id" direction="in"/>
    </method>
    <method name="RemovePackage">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg type="s" name="tid" direction="in"/>
      <arg type="s" name="package_id" direction="in"/>
      <arg type="b" name="allow_deps" direction="in"/>
      <arg type="b" name="autoremove" direction="in"/>
    </method>
    <method name="InstallPackage">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg type="s" name="tid" direction="in"/>
      <arg type="s" name="package_id" direction="in"/>
    </method>

Now, I think this needs to change to:

    <method name="GetFilesInPackages">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg type="s" name="tid" direction="in"/>
      <arg type="as" name="package_ids" direction="in"/>
    </method>
    <method name="RemovePackages">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg type="s" name="tid" direction="in"/>
      <arg type="as" name="package_ids" direction="in"/>
      <arg type="b" name="allow_deps" direction="in"/>
      <arg type="b" name="autoremove" direction="in"/>
    </method>
    <method name="InstallPackages">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
      <arg type="s" name="tid" direction="in"/>
      <arg type="as" name="package_ids" direction="in"/>
    </method>

Now, do all the methods that take a package ID want to be able to do
multiple things? For me this makes sense, as we can do a
GetUpdateDescription on all the updates in the list, and therefore have
no lag when moving between the update viewer. If we only want one
package_id then we just for alist with only one entry. For the backends
that can support this, we can just leave it for them to do, for those
that don't just queue these in the backend (less latency than the
frontend) so in theory nothing should break.

The other problem is how we pass multiple package_ids to the client
methods, like pk_client_update_package. I guess the nicest thing would
be to make these a vararg list, and then just pass NULL to terminate the
list.

We'll do this API break slowly, as I appreciate it's a large internal
and external API change that great potential to go wrong. ;-)

Ideas welcome.

Richard.





More information about the PackageKit mailing list