[packagekit] Session D-BUS API

Richard Hughes hughsient at gmail.com
Fri Mar 6 09:12:46 PST 2009


On Fri, 2009-03-06 at 09:46 -0500, Trever Fischer wrote:
> I've managed to find a bit of time between classes and trying to get elected to 
> student gov't here to start implementing the D-BUS methods for KPackageKit. 
> I've got a couple of questions about it though:

Well, good luck with the elections :-)

> 1. Are methods such as InstallLocalFile, InstallCatalog, etc supposed to be 
> syncronous?

Yes.

> Eg, if an app calls them, should it wait for them to complete 
> before going on and assuming the job completed? I think it'd be easier to 
> implement if they all returned some kind of job ID, and a jobComplete(id) 
> signal got emitted, since the packagekit calls are already asynchronous.

I thought about that, but i really wanted the interface to be
fire-and-forget in that an application just called into the interface,
and it returned with success or failure. This needs to be kept very
simple for most apps.

> Then 
> it'd be up to the specific app developer if they really want the calls to be 
> synchronous or not. I mostly make this point because I'd rather not have a 
> bunch of event loops floating around in kded to convert the native async calls 
> to sync ones.

Yes, lots of event loops are icky.

> The exception of course is IsPackageInstalled.

Sure, but bear in mind this can block for a few minutes too if
packagekitd is servicing other transactions.

> 2. What is InstallProvideFile supposed to do? Is it supposed to search the 
> list of available files for whats needed? Shouldn't whatProvides() be able to 
> handle that?

It literally installs a package that provides the file /usr/bin/foo.
Basically, it's a way for an application to say "I need $this_file --
JUST DO IT" and not worry about all the details.

> 3. What are the xid and timestamp arguments for? Am I correct in assuming xid 
> is an X11 window ID?

Well, you don't need to copy the "old" interface with the timestamps,
and yes, an XID is used to make the download window modal over the
window that launched the window. If the method is async, it also makes
doing that harder. FWIW, I think the max bus timeout is now pretty long
as  long as you set it to MAX_UINT, but I am open to other ways of doing
it as the session methods need to be cross desktop.

Thanks,

Richard.

Richard.





More information about the PackageKit mailing list