[packagekit] Installing PackageKit catalogs
David D Lowe
daviddlowe.flimm at gmail.com
Sun Aug 29 08:11:49 PDT 2010
On 29/08/10 15:18, Richard Hughes wrote:
> Right, so maybe you can use hide-warnings -- I think that "all
> packages already installed" is a warning, not a critical error. What
> UI do you get presented by?
>
> Richard
>
Here's an example test.catalog:
> [PackageKit Catalog]
>
> InstallPackages=hello
I've checked that the package hello is indeed installed.
Here's an example Python script:
> import dbus
> bus = dbus.SessionBus()
>
> proxy = bus.get_object("org.freedesktop.PackageKit",
> "/org/freedesktop/PackageKit")
> iface = dbus.Interface(proxy, "org.freedesktop.PackageKit.Modify")
>
> iface.InstallCatalogs(dbus.UInt32(0), ["/home/david/test.catalog"],
> "hide-warning,hide-confirm-search,hide-confirm-deps,hide-confirm-install,hide-progress,hide-finished")
It displays this dialog:
Install packages in catalogue?
The following packages are marked to be installed from the catalogue:
| | The classic greeting, and a good example
| | hello-2.4-3 (i386)
| Help| | Close | Install |
After clicking install, it fails with this exception stack:
> Traceback (most recent call last):
> File "test.py", line 7, in <module>
> iface.InstallCatalogs(dbus.UInt32(0),
> ["/home/david/test.catalog"],
> "hide-warning,hide-confirm-search,hide-confirm-deps,hide-confirm-install,hide-progress,hide-finished")
> File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in
> __call__
> return self._proxy_method(*args, **keywords)
> File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in
> __call__
> **keywords)
> File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 620, in
> call_blocking
> message, timeout)
> dbus.exceptions.DBusException:
> org.freedesktop.PackageKit.Modify.InternalError: could not do
> simulate: Package hello is already installed
Running gpk-install-catalog test.catalog gives me these results:
First dialog:
Do you want to install this catalogue?
/home/david/test.catalog
| Help| | Close | Install |
Second dialog after clicking install:
Install packages in catalogue?
The following packages are marked to be installed from the catalogue:
| | The classic greeting, and a good example
| | hello-2.4-3 (i386)
| Help| | Close | Install |
Third dialog after clicking install, modal on top of a progress dialog:
Failed to install package
Unknown error. Please refer to the detailed report and report in your
distribution bugtracker
+ More details
| could not do simulate: Package hello is already installed
| Close |
I can't find a way around a dialog being displayed in this case.
Thanks, Richard!
More information about the PackageKit
mailing list