Fix several reported problems with the offline-update funtionality.

This commit is contained in:
Richard Hughes 2012-07-24 13:42:17 +01:00
parent 5d4eae70cf
commit d089707204
2 changed files with 44 additions and 1 deletions

36
PackageKit-master.patch Normal file
View File

@ -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)

View File

@ -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 <rhughes@redhat.com> - 0.8.2-3
- Fix several reported problems with the offline-update funtionality.
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild