[packagekit] Allowing multiple actions in a transaction

Tim Lauridsen tim.lauridsen at googlemail.com
Tue Mar 11 01:56:43 PDT 2008


Richard Hughes wrote:
> 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>
> 

Why not just 'Install', 'Remove' & 'Update'
Not all methods is fit to take multiple packageid, the methods to get 
extra details about a package should not take multiple id.
GetFiles should only take one ID IMO.


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

in the yum backend it will just complicate thing to add an extra End of 
List tag.
The DBUS yum2 backend should take an array, so there is no use of a list 
terminator :)

I don't now about the other ones.

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

i am not convinced that at methods should take list of packages, but it 
not something i feel hard about and it should not be hard to implement.

Tim



More information about the PackageKit mailing list