Bug 24651 - pkcon does not have an option for synchronous processing
Summary: pkcon does not have an option for synchronous processing
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-21 02:52 UTC by Priyank
Modified: 2012-01-05 11:00 UTC (History)
2 users (show)

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 Priyank 2009-10-21 02:52:25 UTC
In PackageKit-0.4.9-1.fc11.i586, pkcon was synchronous, it used to wait till the installation/uninstallation is complete before returning. Since PackageKit-0.4.6-1.fc11.i586 it's asynchronous.

We are using pkcon in a scenario where we need to know when the installation is complete so that the installer can exit. For this we require an option in the pkcon for making it synchronous.
Comment 1 Richard Hughes 2009-10-21 03:55:15 UTC
pkcon is meant to be synchronous, unless you tell it otherwise.  Can you describe the bug in more detail please. Thanks.
Comment 2 Gaurav Khurana 2009-10-25 02:53:18 UTC
(In reply to comment #1)
> pkcon is meant to be synchronous, unless you tell it otherwise.  Can you
> describe the bug in more detail please. Thanks.
> 
Behavior of pkcon in PackageKit-0.4.6-1.fc11:
$ pkcon install <path-of-package>

1. authenticate the user.
2. sends a message to packagekitd to install the package.
3. waits till the package gets installed or installation fails.
4. return the status to the caller.


While the behavior in PackageKit-0.4.9-1.fc11 is:
1. authenticate user.
2. send a message to packagekitd to install the package.
3. returns succes (exit-status 0) to the caller.
4. Installs the package in the background (it may fail or succeed) and the caller doesn't get to know of the final installation status.
Comment 3 Priyank 2009-11-13 02:01:48 UTC
Any update on the issue. Thanks.
Comment 4 Richard Hughes 2009-11-26 02:21:28 UTC
Hmm, I can't find anything wrong -- can you please get the output of:

pkcon -v install <the package you are trying to install>

And attach the output to this bug. The only way I can see that the mainloop is not run (and thus it exits straight away) is when the install fails for some reason.

Thanks,
Comment 5 Priyank 2009-11-26 23:33:50 UTC
> And attach the output to this bug. The only way I can see that the mainloop is
> not run (and thus it exits straight away) is when the install fails for some
> reason.
> 

The package get scheduled for installation couple of seconds after the install command returns.

Log is:
$ pkcon --version
0.4.9

$ pkcon -v install test-2.0.0-0.i386.rpm
TI:12:17:13	FI:egg-debug.c	FN:egg_debug_init,311
 - Verbose debugging 1 (on console 1)PK_VERBOSE
TI:12:17:13	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:13	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:13	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:13	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:13	FI:pk-console.c	FN:main,1918
 - filter=(null), filters=0
TI:12:17:13	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:13	FI:pk-client.c	FN:pk_client_set_tid,3943
 - set tid /916_bbaeccec_data on 0x8f09a70
TI:12:17:13	FI:pk-control.c	FN:pk_control_allocate_transaction_id,644
 - Got tid: '/916_bbaeccec_data'
TI:12:17:13	FI:pk-client.c	FN:pk_client_set_tid,3943
 - set tid /916_bbaeccec_data on 0x8f09810
TI:12:17:13	FI:pk-client.c	FN:pk_client_install_files,3303
 - resolved test-2.0.0-0.i386.rpm to /data/test-2.0.0-0.i386.rpm
TI:12:17:13	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed wait
TI:12:17:13	FI:pk-control.c	FN:pk_control_transaction_list_changed_cb,767
 - emit transaction-list-changed
TI:12:17:13	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed setup
TI:12:17:13	FI:pk-control.c	FN:pk_control_locked_cb,840
 - emit locked 1
TI:12:17:13	FI:pk-client.c	FN:pk_client_allow_cancel_cb,937
 - emit allow-cancel 0
TI:12:17:14	FI:pk-client.c	FN:pk_client_progress_changed_cb,587
 - emit progress-changed 0, 101, 611, 0
TI:12:17:14	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed running
TI:12:17:14	FI:pk-client.c	FN:pk_client_error_code_cb,925
 - emit error-code missing-gpg-signature, Package test-2.0.0-0.i386.rpm is not signed
TI:12:17:14	FI:pk-console.c	FN:pk_console_error_code_cb,1446
 - need to try again with trusted FALSE
TI:12:17:14	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:14	FI:pk-client.c	FN:pk_client_set_tid,3943
 - set tid /917_beceaadd_data on 0x8f09b08
TI:12:17:14	FI:pk-control.c	FN:pk_control_allocate_transaction_id,644
 - Got tid: '/917_beceaadd_data'
TI:12:17:14	FI:pk-client.c	FN:pk_client_set_tid,3943
 - set tid /917_beceaadd_data on 0x8f09940
TI:12:17:14	FI:pk-client.c	FN:pk_client_install_files,3303
 - resolved test-2.0.0-0.i386.rpm to /data/test-2.0.0-0.i386.rpm
TI:12:17:14	FI:pk-client.c	FN:pk_client_error_refused_by_policy,263
 - ERROR: org.freedesktop.PackageKit.Transaction.RefusedByPolicy: org.freedesktop.packagekit.package-install-untrusted auth_admin
TI:12:17:17	FI:pk-client.c	FN:pk_client_error_auth_obtain,313
 - gained org.freedesktop.packagekit.package-install-untrusted privilege = 1
TI:12:17:17	FI:pk-client.c	FN:pk_client_connect,4359
 - connect
TI:12:17:17	FI:pk-client.c	FN:pk_client_set_tid,3943
 - set tid /918_bdcbaaac_data on 0x8f09ba0
TI:12:17:17	FI:pk-control.c	FN:pk_control_allocate_transaction_id,644
 - Got tid: '/918_bdcbaaac_data'
TI:12:17:17	FI:pk-client.c	FN:pk_client_set_tid,3943
 - set tid /918_bdcbaaac_data on 0x8f09940
TI:12:17:17	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed wait
Error: missing-gpg-signature: Package test-2.0.0-0.i386.rpm is not signed
TI:12:17:17	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed finished
TI:12:17:17	FI:pk-control.c	FN:pk_control_locked_cb,840
 - emit locked 0
TI:12:17:17	FI:pk-client.c	FN:pk_client_finished_cb,556
 - emit finished failed, 622
TI:12:17:17	FI:pk-console.c	FN:pk_console_finished_cb,582
 - install-files runtime was 0.6 seconds
TI:12:17:17	FI:pk-console.c	FN:pk_console_finished_cb,599
 - waiting for second install file to finish
TI:12:17:17	FI:pk-control.c	FN:pk_control_transaction_list_changed_cb,767
 - emit transaction-list-changed
TI:12:17:17	FI:pk-client.c	FN:pk_client_destroy_cb,531
 - emit destroy /918_bdcbaaac_data
TI:12:17:17	FI:pk-control.c	FN:pk_control_transaction_list_changed_cb,767
 - emit transaction-list-changed
TI:12:17:17	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed setup
TI:12:17:17	FI:pk-control.c	FN:pk_control_locked_cb,840
 - emit locked 1
TI:12:17:17	FI:pk-client.c	FN:pk_client_allow_cancel_cb,937
 - emit allow-cancel 0
TI:12:17:17	FI:pk-client.c	FN:pk_client_progress_changed_cb,587
 - emit progress-changed 0, 101, 12, 0
TI:12:17:17	FI:pk-client.c	FN:pk_client_change_status,598
 - emit status-changed running
TI:12:17:19	FI:pk-client.c	FN:pk_client_destroy_cb,531
 - emit destroy /916_bbaeccec_data
TI:12:17:19	FI:pk-console.c	FN:pk_console_destroy_cb,550
 - quitting loop due to transaction being destroyed

Comment 6 Richard Hughes 2010-03-23 08:47:01 UTC
Could you try the latest 0.5.x release please, this seems to work for me. Thanks.


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.