[packagekit] Adding support for "prepare" in transaction_flags

Sebastian Heinlein glatzor at ubuntu.com
Sun Jun 3 22:34:31 PDT 2012


Am Montag, den 04.06.2012, 00:33 +0200 schrieb Matthias Klumpp: 
> Hi!
> 
> 2012/6/4 Richard Hughes <hughsient at gmail.com>:
> > On 3 June 2012 23:03, Matthias Klumpp <matthias at tenstral.net> wrote:
> >> Sounds sane to me! Thanks for thinking about this :-)
> >
> > Except we need a new name. Commit() is used quite a lot in PackageKit
> > internally, and a new concept with the same name makes the code as
> > confusing as hell. Better ideas welcome. Perhaps
> > Transaction.Complete(), Transaction.Exec(), Transaction.Go()?
> Transaction.Execute() sounds good, as "complete" would be more like a
> state name ("transaction is completed")
> Go() is also okay.

In the beginning of aptdaemon I adopted the PackageKit interface design,
but introduced some changes later: I moved all the transaction role
methods (InstallPackages(), RemovePackages(), GetUpdates(), etc...) to
the main interface (which would be org.freedesktop.PackageKit in this
case), see [1].

The methods return the tid of a new transaction which already has its
role set. The methods on the transaction interface are only used to
modify the transaction. The authentication happens at the Run() call of
the transaction - this allows users to simulate transactions without
having to authenticate.

So you could have only SetHints(), Cancel(), Prepare(), Simulate() and
Run() or Commit() methods on the transaction interface. This should make
the design more clearer.

[1]
http://packages.python.org/aptdaemon/dbus.html#org-debian-apt-transaction-the-transaction-interface
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20120604/3a4988d9/attachment.pgp>


More information about the PackageKit mailing list