[packagekit] license handling

Richard Hughes hughsient at gmail.com
Thu Apr 3 06:05:59 PDT 2008


On Thu, 2008-04-03 at 14:44 +0200, Stefan Haas wrote:
> before installing or updating a package sometimes it's necessary to
> accept or decline a license.
> How to handle this with packageKit?

Right, I've been deliberately putting this off, so maybe no we should
talk about accepting EULAs and stuff. :-)

As you know, the eula screen prompt can only be done at the start of the
transaction when installing, and can't be shown when updating a package.
This is so we get the fire-and-forget use case.

I think what would make sense is for the backend to do the
InstallPackage(), and then if it needs to it can ask packagekitd
HasUserAcceptedLicence(s=licence_enum). 

If this is true, then the install can proceed.

If it is false, then the following custom signal is emitted:

LicencePromptRequired(s=licence_enum, s=company, s=eula_text)

Or something like that. When the user clicks "No" on the dialog then no
changes happen, and the licence prompt would re-appear next time as
well.

If the user clicks "Yes" (in the session) then the
AcceptLicence(s=licence_enum) method on org.freedesktop.PackageKit will
be fired. This is controlled by the policykit action
is-user-allowed-to-accept-eulas so it might ask them to authenticate or
get the admin to do so. Distros can set the default policy if they think
that a user that installs packages without passwords can also accept the
eula.

This method sets the value in the state database so that future users
of HasUserAcceptedLicence(s=licence_enum) return true.

Now, how much of that sounds insane? :-)

Richard.





More information about the PackageKit mailing list