virt-manager/535ff0b7-fix-install-when-one-package-is-already-installed.patch
Charles Arnold 78a202101a - Upstream bug fixes
535fb6f6-hide-scrollbar-until-something-scrollable.patch
  535fe0c2-fix-screenshot-with-qxl-spice.patch
  535feaca-fix-storage-when-directory-name-contains-whitespace.patch
  535ff0b7-fix-install-when-one-package-is-already-installed.patch 
  536152fe-fix-error-detecting-OS-in-show-all-list.patch
  536154d8-show-error-if-launching-delete-dialog-fails.patch
  53615662-call-path_exists-before-getting-storage-volume.patch

- s390x: Set the correct emulator 
  virtinst-set-qemu-emulator.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=169
2014-05-01 03:32:04 +00:00

42 lines
1.5 KiB
Diff

Subject: packageutils: Fix install when one package is already installed (bz 1090181)
From: Cole Robinson crobinso@redhat.com Tue Apr 29 14:34:31 2014 -0400
Date: Tue Apr 29 14:34:31 2014 -0400:
Git: 15449eb12601ec1b88aa6d8ee52986ef5ab41ae2
Index: virt-manager-1.0.1/virtManager/packageutils.py
===================================================================
--- virt-manager-1.0.1.orig/virtManager/packageutils.py
+++ virt-manager-1.0.1/virtManager/packageutils.py
@@ -53,7 +53,12 @@ def check_packagekit(parent, errbox, pac
return
try:
- packagekit_install(parent, packages)
+ for package in packages[:]:
+ if packagekit_isinstalled(package):
+ packages.remove(package)
+
+ if packages:
+ packagekit_install(parent, packages)
except Exception, e:
# PackageKit frontend should report an error for us, so just log
# the actual error
@@ -63,6 +68,16 @@ def check_packagekit(parent, errbox, pac
return True
+def packagekit_isinstalled(package):
+ bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
+ pk_control = Gio.DBusProxy.new_sync(bus, 0, None,
+ "org.freedesktop.PackageKit",
+ "/org/freedesktop/PackageKit",
+ "org.freedesktop.PackageKit.Query", None)
+
+ return pk_control.IsInstalled("(ss)", package, "")
+
+
def packagekit_install(parent, package_list):
bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
pk_control = Gio.DBusProxy.new_sync(bus, 0, None,