Bug 285266 - [PATCH] Apper fails to install updates which require license agreement
Summary: [PATCH] Apper fails to install updates which require license agreement
Status: RESOLVED FIXED
Alias: None
Product: apper
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR major
Target Milestone: ---
Assignee: Daniel Nicoletti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-29 15:56 UTC by Will Stephenson
Modified: 2011-11-24 10:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch partially resolving the issue (1.10 KB, patch)
2011-10-29 20:38 UTC, Will Stephenson
Details
Experimental logic shuffle (1.81 KB, patch)
2011-11-01 07:07 UTC, Will Stephenson
Details
Cleaner version of prior patch (865 bytes, patch)
2011-11-01 15:16 UTC, Will Stephenson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Will Stephenson 2011-10-29 15:56:22 UTC
Version:           unspecified
OS:                Linux

After authenticating with Polkit and clicking 'accept agreement' on the agreement dialog, Apper stays in the 'waiting for service to start' state that it was in while the modal license agreement dialog was visible.

Reproducible: Didn't try

Steps to Reproduce:
Try to install an update which requires license agreement (eg flash-player) on openSUSE

Actual Results:  
Installation fails to proceed as above

Expected Results:  
Install the update
Comment 1 Will Stephenson 2011-10-29 20:38:13 UTC
Created attachment 65028 [details]
Patch partially resolving the issue

The attached patch partially solves the issue by correcting the signal and slot names in the connect() between the LicenseAgreementDialog and the handlers so clicking Accept actually accepts the eula.

HOWEVER after accepting the eula, Apper returns to the update list, still showing the accepted package.  It is necessary to accept this update again to actually perform the installation.  The second time, there is no eula request from PK (I guess it has cached the previous acceptance) and the installation of the update goes through.  I assume that the logic inside Apper to perform the installation immediately after accepting the eula is faulty.
Comment 2 Will Stephenson 2011-10-29 20:45:41 UTC
How many attempts are needed to get the installation to succeed appears to be non-deterministic.  I just retried and had to make 3 attempts vs 2 above.
Comment 3 Daniel Nicoletti 2011-10-31 14:12:16 UTC
Patch applied thanks.
Comment 4 Will Stephenson 2011-11-01 07:07:56 UTC
Created attachment 65100 [details]
Experimental logic shuffle

This patch moves the requeueTransaction() call from the Transaction::ExitSucceeded case on the earlier transaction to the Transaction::ExitEulaRequired case.

The result is that the eula update is checked in the list of updates and clicking Apply a second time installs it.

Daniel: I would like the installation to proceed immediately after the user Accepts the LicenseAgreement dialog though, how can we do this?
Comment 5 Will Stephenson 2011-11-01 15:16:24 UTC
Created attachment 65120 [details]
Cleaner version of prior patch
Comment 6 Will Stephenson 2011-11-01 20:26:37 UTC
The patch to PackageKit (http://paste.ubuntu.com/725631) doesn't apply at all to PackageKit 0.6.19 - the code has changed unrecognisably.  We can't ship a different version of PK so late in the openSUSE release cycle.  Is it possible for you to adapt the change to 0.6.19?
Comment 7 Daniel Nicoletti 2011-11-24 10:52:13 UTC
The patch was backported to the PackageKit's 0.6.X versions, I've tested it and it is working ok now.