pickup/test upstream crash fix (kde#315009)

epel9
Rex Dieter 12 years ago
parent 8fdc212c18
commit e5ae2081a9

@ -0,0 +1,79 @@
From da41de0e4a98eed232eb05a14e903666dbb21838 Mon Sep 17 00:00:00 2001
From: Daniel Nicoletti <dantti12@gmail.com>
Date: Thu, 7 Mar 2013 00:40:13 -0300
Subject: [PATCH 5/5] Make sure we set an error if we fail to contact
PackageKit Fixes KDE Bug: 315009
---
src/transaction.cpp | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/src/transaction.cpp b/src/transaction.cpp
index 47b3c56..41884a7 100644
--- a/src/transaction.cpp
+++ b/src/transaction.cpp
@@ -67,19 +67,19 @@ bool Transaction::init(const QDBusObjectPath &tid)
// he want us to get it
if (tid.path().isNull()) {
d->tid = Daemon::global()->getTid();
+ if (d->tid.path().isEmpty()) {
+ d->error = Transaction::InternalErrorDaemonUnreachable;
+ return false;
+ }
} else {
d->tid = tid;
}
- if (d->tid.path().isEmpty()) {
- d->error = Transaction::InternalErrorDaemonUnreachable;
- return false;
- } else {
-
- }
-
int retry = 0;
do {
+ if (d->p) {
+ delete d->p;
+ }
d->p = new TransactionProxy(QLatin1String(PK_NAME),
d->tid.path(),
QDBusConnection::systemBus(),
@@ -95,23 +95,24 @@ bool Transaction::init(const QDBusObjectPath &tid)
message << qVariantFromValue(0U);
QDBusConnection::sessionBus().call(message, QDBus::BlockWithGui);
- // The transaction was not created
- delete d->p;
- d->p = 0;
retry++;
} else {
retry = 0;
}
} while (retry == 1);
- // if the transaction proxy was not created return false
- if (!d->p) {
+ // if the transaction proxy was not created return false and set the error
+ if (!d->p->isValid()) {
+ // The transaction was not created
+ d->error = Transaction::InternalErrorCannotStartDaemon;
+ emit errorCode(Transaction::ErrorInternalError, d->p->lastError().message());
+ delete d->p;
return false;
- } else {
- d->error = Transaction::InternalErrorNone;
- if (!Daemon::global()->hints().isEmpty()) {
- setHints(Daemon::global()->hints());
- }
+ }
+
+ d->error = Transaction::InternalErrorNone;
+ if (!Daemon::global()->hints().isEmpty()) {
+ setHints(Daemon::global()->hints());
}
connect(d->p, SIGNAL(Changed()),
--
1.8.1.4

@ -1,12 +1,15 @@
Summary: Qt support library for PackageKit Summary: Qt support library for PackageKit
Name: PackageKit-Qt Name: PackageKit-Qt
Version: 0.8.7 Version: 0.8.7
Release: 2%{?dist} Release: 3%{?dist}
License: LGPLv2+ License: LGPLv2+
URL: http://www.packagekit.org/ URL: http://www.packagekit.org/
Source0: http://www.packagekit.org/releases/%{name}-%{version}.tar.xz Source0: http://www.packagekit.org/releases/%{name}-%{version}.tar.xz
## upstream patches
Patch100: 0005-Make-sure-we-set-an-error-if-we-fail-to-contact-Pack.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: pkgconfig(QtDBus) pkgconfig(QtSql) BuildRequires: pkgconfig(QtDBus) pkgconfig(QtSql)
@ -34,6 +37,8 @@ Development headers and libraries for PackageKit-Qt.
%prep %prep
%setup -q %setup -q
%patch100 -p1 -b .0005
%build %build
mkdir -p %{_target_platform} mkdir -p %{_target_platform}
@ -68,6 +73,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%changelog %changelog
* Thu Mar 07 2013 Rex Dieter <rdieter@fedoraproject.org> 0.8.7-3
- pickup/test upstream crash fix (kde#315009)
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-2 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

Loading…
Cancel
Save