[packagekit] license handling
Tim Lauridsen
tim.lauridsen at googlemail.com
Thu Apr 3 11:13:38 PDT 2008
Richard Hughes wrote:
> 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? :-)
All of it :)
This will not work when using helper scripts, where you only pass stuff
to the script when it is startet, so the script cant read data from
packagekit while running the action.
The most sane way i can think of is having a flag in the package meta
data indicating that the package has and eula etc.
and add a method for getting the eula from the backend for a pkgid.
then a user what to install/update a package the pk should call
GetEULA if the flag is set and present the eula the user to accept and
if the user accept it, then InstallPackage is called to install it.
Tim
More information about the PackageKit
mailing list