mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Fix package install with PackageKit 0.8.4
This commit is contained in:
parent
96ce9ac0b1
commit
35bab2cc98
@ -135,7 +135,15 @@ def packagekit_install(package_list):
|
||||
timeout=timeout)
|
||||
|
||||
def packagekit_search(session, pk_control, package_name, packages):
|
||||
tid = pk_control.GetTid()
|
||||
newstyle = False
|
||||
try:
|
||||
tid = pk_control.GetTid()
|
||||
except dbus.exceptions.DBusException, e:
|
||||
if e.get_dbus_name() != "org.freedesktop.DBus.Error.UnknownMethod":
|
||||
raise
|
||||
newstyle = True
|
||||
tid = pk_control.CreateTransaction()
|
||||
|
||||
pk_trans = dbus.Interface(
|
||||
session.get_object("org.freedesktop.PackageKit", tid),
|
||||
"org.freedesktop.PackageKit.Transaction")
|
||||
@ -160,7 +168,10 @@ def packagekit_search(session, pk_control, package_name, packages):
|
||||
pk_trans.connect_to_signal('ErrorCode', error)
|
||||
pk_trans.connect_to_signal('Package', package)
|
||||
try:
|
||||
pk_trans.SearchNames("installed", [package_name])
|
||||
searchtype = "installed"
|
||||
if newstyle:
|
||||
searchtype = 2 ** 2
|
||||
pk_trans.SearchNames(searchtype, [package_name])
|
||||
except dbus.exceptions.DBusException, e:
|
||||
if e.get_dbus_name() != "org.freedesktop.DBus.Error.UnknownMethod":
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user