From d089707204af1bc84fb372f7672fe711e80d2a1b Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Jul 24 2012 12:42:17 +0000 Subject: Fix several reported problems with the offline-update funtionality. --- diff --git a/PackageKit-master.patch b/PackageKit-master.patch new file mode 100644 index 0000000..4f1fa50 --- /dev/null +++ b/PackageKit-master.patch @@ -0,0 +1,36 @@ +diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py +index 0748264..f5216ec 100755 +--- a/backends/yum/yumBackend.py ++++ b/backends/yum/yumBackend.py +@@ -3254,7 +3254,7 @@ class DownloadCallback(BaseMeter): + if name: + pkg = self._getPackage(name) + if pkg: +- self.base.item_progress(self.base._pkg_to_id(pkg), val) ++ self.base.item_progress(self.base._pkg_to_id(pkg), STATUS_DOWNLOAD, val) + + # package finished + if val == 100 and name: +@@ -3312,16 +3312,17 @@ class PackageKitCallback(RPMBaseCallback): + self.base.message(MESSAGE_BACKEND_ERROR, "The constant '%s' was unknown, please report. details: %s" % (action, _to_unicode(e))) + + # set item percentage +- #if package and te_total > 0: +- # val = (te_current*100L)/te_total +- # if self.curpkg: +- # self.base.item_progress(self.base._pkg_to_id(self.curpkg), val) ++ if package and te_total > 0: ++ val = (te_current*100L) / te_total ++ if self.curpkg: ++ self.base.item_progress(self.base._pkg_to_id(self.curpkg), STATUS_INSTALL, val) + + # find out the offset + pct_start = StatusPercentageMap[STATUS_INSTALL] + + # do percentage +- if ts_total > 0: ++ if ts_total > 0 and te_total > 0: ++ val = (te_current * 100L) / te_total + div = (100 - pct_start) / ts_total + pct = div * (ts_current - 1) + pct_start + ((div / 100.0) * val) + self.base.percentage(pct) diff --git a/PackageKit.spec b/PackageKit.spec index b3f4a6e..0b7ec39 100644 --- a/PackageKit.spec +++ b/PackageKit.spec @@ -3,7 +3,7 @@ Summary: Package management service Name: PackageKit Version: 0.8.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and LGPLv2+ URL: http://www.packagekit.org Source0: http://www.packagekit.org/releases/%{name}-%{version}.tar.xz @@ -17,6 +17,9 @@ Patch1: PackageKit-0.4.4-Fedora-turn-off-time.conf.patch # Upstreamable? allow use of xulrunner2 for browser-plugin support Patch4: PackageKit-0.7.4-xulrunner2.patch +# Backported from master +Patch9: PackageKit-master.patch + Requires: %{name}-glib%{?_isa} = %{version}-%{release} Requires: PackageKit-backend Requires: shared-mime-info @@ -255,6 +258,7 @@ user to restart the computer or remove and re-insert the device. %patch0 -p1 -b .fedora %patch1 -p1 -b .no-time %patch4 -p1 -b .xulrunner2 +%patch9 -p1 -b .master NOCONFIGURE=1 ./autogen.sh %build @@ -467,6 +471,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %{_libdir}/pkgconfig/packagekit-plugin.pc %changelog +* Tue Jul 24 2012 Richard Hughes - 0.8.2-3 +- Fix several reported problems with the offline-update funtionality. + * Wed Jul 18 2012 Fedora Release Engineering - 0.8.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild