[packagekit] Adding a recursive flag to GetDepends and GetRequires

Richard Hughes hughsient at gmail.com
Wed Nov 7 10:42:54 PST 2007


Guys,

I'm about to commit a patch which adds a boolean flag "recursive" to the
GetDepends and GetRequires method.

>From the description in the developer documentation:

GetRequires:
If recursive is true: This means if gnome-power-manager depends on
NetworkManager and NetworkManager depends on HAL, then GetRequires on
HAL should return both gnome-power-manager and NetworkManager.

GetDepends:
If recursive is true: This means if gnome-power-manager depends on
NetworkManager and NetworkManager depends on HAL, then GetDepends on
gnome-power-manager should return both HAL and NetworkManager.

Why does this belong in the backends? Well, I tried doing this with lots
of recursive calls to GetRequires(package_id) and for "gimp" it took a
long time, when in yum took a few seconds. The backend doesn't have to
do all this IPC, and so can do it much quicker.

If your backend can't do a recursive GetDepends or GetRequires, just
ignore the flag; anything is better than nothing.

I've done my best to compile-fix all the backends, although I've
probably broken something. Could you backend dudes please make sure
everything still works, and add the new feature if you get a few
minutes.

Adding this means we can do the right thing in pkcon and pk-application
eventually, and present the user with a _sane_ warning box or command
line error, with the option to continue and perform the action.

Thanks,

Richard.





More information about the PackageKit mailing list