Bug 27527 - pk_backend_get_depends incorrectly sets role
Summary: pk_backend_get_depends incorrectly sets role
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-07 16:43 UTC by Jonathan Conder
Modified: 2010-04-12 16:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Conder 2010-04-07 16:43:36 UTC
Hi, I've just started using PackageKit 0.6.3 and noticed that extra dependencies are not reported properly when I try to install something. I've tracked the problem down to pk_backend_get_depends setting the role to get-depends, which means that pk_backend_package doesn't convert available to installing when get_depends is called as a substitute for simulate_install_packages.
To fix, you could either remove the set_role calls from pk-backend.c (because PkTransaction sets them anyway), or change the role testing in pk_backend_package to get_depends or get_requires. I wasn't sure which one to do myself.
Thanks
Comment 1 Richard Hughes 2010-04-08 11:18:49 UTC
The reason the backend now set's it's own role is for threaded backends that need to know the backend-role when passed to a generic threading function. I didn't remember about the fallback code, as I agree the code is now broken.

I've applied:

commit d0c0f27a68e67ab2d4b64348cf48e8ea65cd23d4
Author: Richard Hughes <richard@hughsie.com>
Date:   Thu Apr 8 19:17:22 2010 +0100

    Correctly fallback by checking the transaction role, not the backend role. Fixes fd#27527

Could you test git master please? Thanks.
Comment 2 Jonathan Conder 2010-04-12 04:06:05 UTC
I'm not seeing any updates at http://cgit.freedesktop.org/packagekit/
Is there somewhere else I should be looking?

Anyway, I went ahead and implemented SimulateInstallPackages properly, so I'm not affected by it anymore. I'll still test your changes if you want, but feel free to mark this fixed.
Comment 3 Richard Hughes 2010-04-12 11:42:21 UTC
Sorry, I forgot to push the branch. It should be there now. We use a development server and then push to public anon-git every few days. If you're developing a backend I should really give you access to the development machine (and commit access); yell if this is what you want.
Comment 4 Jonathan Conder 2010-04-12 16:43:40 UTC
Ok, no worries. I'll test it when I get the chance. I'm not sure my backend is quite ready yet, but I'll let you know when it is.

It's a replacement for the alpm backend, but I'm not sure whether to keep that around or not, as mine has an additional dependency (on my own wrapper library). I had been in contact with the developer, but haven't heard from him in a while.

If you want to review it, there's a patch for PackageKit here: http://github.com/PirateJonno/pacman-glib/blob/master/pk-backend/packagekit/pacman-glib.patch
I imagine it will be ready to commit in a couple of weeks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.