[polkit-qt/f16] - pull a couple more upstream patches - -devel: drop Req: polkit-devel

Rex Dieter rdieter at fedoraproject.org
Mon Dec 12 13:58:43 UTC 2011


commit 9a9b1c8416242f77873ad767aa660cf6c3c2ce97
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Mon Dec 12 07:58:09 2011 -0600

    - pull a couple more upstream patches
    - -devel: drop Req: polkit-devel

 0001-Post-tagging-version-bump.patch               |   25 +++++
 0002-pedantic.patch                                |   24 +++++
 ...use-REQUIRED-for-pkg-config-since-the-res.patch |   30 ++++++
 ...void-crash-when-ConsoleKit-is-unavailable.patch |   37 +++++++
 0005-BUG-258916.patch                              |  109 ++++++++++++++++++++
 polkit-qt.spec                                     |   26 ++++-
 6 files changed, 245 insertions(+), 6 deletions(-)
---
diff --git a/0001-Post-tagging-version-bump.patch b/0001-Post-tagging-version-bump.patch
new file mode 100644
index 0000000..c972c1b
--- /dev/null
+++ b/0001-Post-tagging-version-bump.patch
@@ -0,0 +1,25 @@
+From 04b2ab6bff36f89b7c15334c8761cd3d2bbdd13a Mon Sep 17 00:00:00 2001
+From: Dario Freddi <drf at kde.org>
+Date: Thu, 9 Dec 2010 00:05:50 +0100
+Subject: [PATCH 1/5] Post-tagging version bump.
+
+---
+ CMakeLists.txt |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 16cc262..ca245ca 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -50,7 +50,7 @@ endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSI
+ 
+ set(POLKITQT-1_VERSION_MAJOR 0 CACHE INT "PolkitQt-1's major version number" FORCE)
+ set(POLKITQT-1_VERSION_MINOR 99 CACHE INT "PolkitQt-1's minor version number" FORCE)
+-set(POLKITQT-1_VERSION_PATCH 0 CACHE INT "PolkitQt-1's release version number" FORCE)
++set(POLKITQT-1_VERSION_PATCH 1 CACHE INT "PolkitQt-1's release version number" FORCE)
+ set(POLKITQT-1_VERSION_STRING
+     "${POLKITQT-1_VERSION_MAJOR}.${POLKITQT-1_VERSION_MINOR}.${POLKITQT-1_VERSION_PATCH}")
+ 
+-- 
+1.7.7.4
+
diff --git a/0002-pedantic.patch b/0002-pedantic.patch
new file mode 100644
index 0000000..91adc8e
--- /dev/null
+++ b/0002-pedantic.patch
@@ -0,0 +1,24 @@
+From ea0b2e4a923cf3d8c73c623bd8072e39c148a8ff Mon Sep 17 00:00:00 2001
+From: Andre Woebbeking <Woebbeking at kde.org>
+Date: Mon, 7 Feb 2011 18:19:05 +0100
+Subject: [PATCH 2/5] -pedantic
+
+---
+ core/polkitqt1-actiondescription.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/core/polkitqt1-actiondescription.h b/core/polkitqt1-actiondescription.h
+index e01f2ff..deed65d 100644
+--- a/core/polkitqt1-actiondescription.h
++++ b/core/polkitqt1-actiondescription.h
+@@ -144,6 +144,6 @@ private:
+ };
+ }
+ 
+-Q_DECLARE_METATYPE(PolkitQt1::ActionDescription::List);
++Q_DECLARE_METATYPE(PolkitQt1::ActionDescription::List)
+ 
+ #endif //POLKIT_QT_ACTION_DESCRIPTION_H
+-- 
+1.7.7.4
+
diff --git a/0003-no-need-to-use-REQUIRED-for-pkg-config-since-the-res.patch b/0003-no-need-to-use-REQUIRED-for-pkg-config-since-the-res.patch
new file mode 100644
index 0000000..e7895e0
--- /dev/null
+++ b/0003-no-need-to-use-REQUIRED-for-pkg-config-since-the-res.patch
@@ -0,0 +1,30 @@
+From cd5ecb65a18819eb98e7446e2be35e56dd033534 Mon Sep 17 00:00:00 2001
+From: Alex Neundorf <neundorf at kde.org>
+Date: Sat, 14 May 2011 22:01:38 +0200
+Subject: [PATCH 3/5] -no need to use "REQUIRED" for pkg-config, since the
+ result is checked later on anyway via
+ find_package_handle_standard_args()
+
+Alex
+---
+ cmake/modules/FindPolkit.cmake |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/modules/FindPolkit.cmake b/cmake/modules/FindPolkit.cmake
+index 5eed321..35fc86e 100644
+--- a/cmake/modules/FindPolkit.cmake
++++ b/cmake/modules/FindPolkit.cmake
+@@ -21,8 +21,8 @@ if (NOT WIN32)
+    # use pkg-config to get the directories and then use these values
+    # in the FIND_PATH() and FIND_LIBRARY() calls
+    find_package(PkgConfig)
+-   pkg_check_modules(PC_POLKIT REQUIRED polkit-gobject-1)
+-   pkg_check_modules(PC_POLKIT_AGENT REQUIRED polkit-agent-1)
++   pkg_check_modules(PC_POLKIT polkit-gobject-1)
++   pkg_check_modules(PC_POLKIT_AGENT polkit-agent-1)
+    set(POLKIT_DEFINITIONS ${PC_POLKIT_CFLAGS_OTHER})
+ endif (NOT WIN32)
+ 
+-- 
+1.7.7.4
+
diff --git a/0004-avoid-crash-when-ConsoleKit-is-unavailable.patch b/0004-avoid-crash-when-ConsoleKit-is-unavailable.patch
new file mode 100644
index 0000000..ae9496c
--- /dev/null
+++ b/0004-avoid-crash-when-ConsoleKit-is-unavailable.patch
@@ -0,0 +1,37 @@
+From eeef90fc5196c5056c8c4ada7b1b5d74db1e5c94 Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <mueller at kde.org>
+Date: Fri, 10 Jun 2011 10:28:19 +0200
+Subject: [PATCH 4/5] avoid crash when ConsoleKit is unavailable
+
+---
+ core/polkitqt1-authority.cpp |   14 ++++++++------
+ 1 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
+index d112031..0951d97 100644
+--- a/core/polkitqt1-authority.cpp
++++ b/core/polkitqt1-authority.cpp
+@@ -219,12 +219,14 @@ void Authority::Private::init()
+     // then we need to extract all seats from ConsoleKit
+     QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats");
+     msg = QDBusConnection::systemBus().call(msg);
+-    // this method returns a list with present seats
+-    QList<QString> seats;
+-    qVariantValue<QDBusArgument> (msg.arguments()[0]) >> seats;
+-    // it can be multiple seats present so connect all their signals
+-    Q_FOREACH(const QString &seat, seats) {
+-        seatSignalsConnect(seat);
++    if (!msg.arguments().isEmpty()) {
++        // this method returns a list with present seats
++        QList<QString> seats;
++        qVariantValue<QDBusArgument> (msg.arguments()[0]) >> seats;
++        // it can be multiple seats present so connect all their signals
++        Q_FOREACH(const QString &seat, seats) {
++            seatSignalsConnect(seat);
++        }
+     }
+ }
+ 
+-- 
+1.7.7.4
+
diff --git a/0005-BUG-258916.patch b/0005-BUG-258916.patch
new file mode 100644
index 0000000..027b4cf
--- /dev/null
+++ b/0005-BUG-258916.patch
@@ -0,0 +1,109 @@
+From d3c337da01f3887da031fdb5c2ac784fb3e79210 Mon Sep 17 00:00:00 2001
+From: Nick Shaforostoff <shafff at ukr.net>
+Date: Mon, 12 Dec 2011 01:03:35 +0200
+Subject: [PATCH 5/5] BUG: 258916
+
+use stricter refing in all places of 'identity' keeping.
+it is interesting that it would be much harder
+to accidentaly make same mistake if G API was C++ style and not C.
+
+i also moved cleanup of successful sessions in time from system shutdown
+to session completion as polkit docs say it should be
+---
+ agent/polkitqt1-agent-session.cpp |   14 +++++++++++---
+ core/polkitqt1-identity.cpp       |   15 +++++++++++++--
+ 2 files changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/agent/polkitqt1-agent-session.cpp b/agent/polkitqt1-agent-session.cpp
+index 20cd403..52ddacf 100644
+--- a/agent/polkitqt1-agent-session.cpp
++++ b/agent/polkitqt1-agent-session.cpp
+@@ -46,7 +46,7 @@ public:
+ 
+ Session::Private::~Private()
+ {
+-    g_object_unref(polkitAgentSession);
++    // polkitAgentSession is freed in Session d'tor
+ }
+ 
+ Session::Session(const PolkitQt1::Identity &identity, const QString &cookie, AsyncResult *result, QObject *parent)
+@@ -74,6 +74,9 @@ Session::Session(PolkitAgentSession *pkAgentSession, QObject *parent)
+ 
+ Session::~Session()
+ {
++    if (d->polkitAgentSession)
++        g_object_unref(d->polkitAgentSession);
++
+     delete d;
+ }
+ 
+@@ -101,7 +104,11 @@ void Session::Private::completed(PolkitAgentSession *s, gboolean gained_authoriz
+ {
+     qDebug() << "COMPLETED";
+     Session *session = (Session *)user_data;
+-    Q_EMIT((Session *)user_data)->completed(gained_authorization);
++    Q_EMIT(session)->completed(gained_authorization);
++
++    //free session here as polkit documentation asks
++    g_object_unref(session->d->polkitAgentSession);
++    session->d->polkitAgentSession = 0;
+ }
+ 
+ void Session::Private::request(PolkitAgentSession *s, gchar *request, gboolean echo_on, gpointer user_data)
+@@ -139,7 +146,8 @@ AsyncResult::AsyncResult(GSimpleAsyncResult *result)
+ 
+ AsyncResult::~AsyncResult()
+ {
+-    g_object_unref(d->result);
++    if (d->result)
++        g_object_unref(d->result);
+ }
+ 
+ void AsyncResult::setCompleted()
+diff --git a/core/polkitqt1-identity.cpp b/core/polkitqt1-identity.cpp
+index abf5abb..9cef558 100644
+--- a/core/polkitqt1-identity.cpp
++++ b/core/polkitqt1-identity.cpp
+@@ -35,11 +35,13 @@ public:
+         : QSharedData(other)
+         , identity(other.identity)
+     {
+-        g_object_ref(identity);
++        if (identity)
++            g_object_ref(identity);
+     }
+     ~Data()
+     {
+-        g_object_unref(identity);
++        if (identity)
++            g_object_unref(identity);
+     }
+ 
+     PolkitIdentity *identity;
+@@ -56,6 +58,8 @@ Identity::Identity(PolkitIdentity *polkitIdentity)
+ {
+     g_type_init();
+     d->identity = polkitIdentity;
++    if (d->identity)
++        g_object_ref(d->identity);
+ }
+ 
+ Identity::Identity(const PolkitQt1::Identity& other)
+@@ -86,7 +90,14 @@ PolkitIdentity *Identity::identity() const
+ 
+ void Identity::setIdentity(PolkitIdentity *identity)
+ {
++    if (d->identity == identity)
++        return;
++    
++    if (d->identity)
++        g_object_unref(d->identity);
+     d->identity = identity;
++    if (d->identity)
++        g_object_ref(d->identity);
+ }
+ 
+ QString Identity::toString() const
+-- 
+1.7.7.4
+
diff --git a/polkit-qt.spec b/polkit-qt.spec
index 1b1dcbb..ef7ed25 100644
--- a/polkit-qt.spec
+++ b/polkit-qt.spec
@@ -13,8 +13,12 @@ BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Patch0:          polkit-qt-0.95.1-install-cmake-find.patch
 
 ## upstream patches
+Patch101: 0001-Post-tagging-version-bump.patch
+Patch102: 0002-pedantic.patch
+Patch103: 0003-no-need-to-use-REQUIRED-for-pkg-config-since-the-res.patch
+Patch104: 0004-avoid-crash-when-ConsoleKit-is-unavailable.patch
 # http://bugs.kde.org/258916
-Patch100:        polkit-qt-kdebug258916.patch
+Patch105: 0005-BUG-258916.patch
 
 Source10: macros.polkit-qt
 
@@ -37,7 +41,6 @@ Summary: Development files for PolicyKit Qt bindings
 Group: Development/Libraries
 Provides: polkit-qt-1-devel = %{version}-%{release}
 Requires: %{name}%{?_isa} = %{version}-%{release}
-Requires: polkit-devel
 %description devel
 %{summary}.
 
@@ -56,11 +59,21 @@ BuildArch: noarch
 # module installation
 %patch0 -p1 -b .install-cmake-find
 
+## skip this one for now, it bumps the reported version
+#patch101 -p1 -b .0001
+%patch102 -p1 -b .0002
+%patch103 -p1 -b .0003
+%patch104 -p1 -b .0004
+%patch105 -p1 -b .0005
+
 
 %build
 mkdir -p %{_target_platform}
 pushd %{_target_platform}
-%{cmake} -DBUILD_EXAMPLES=0 -DDATA_INSTALL_DIR=%{_datadir} ..
+%{cmake} \
+  -DBUILD_EXAMPLES:BOOL=0 \
+  -DDATA_INSTALL_DIR:PATH=%{_datadir} \
+  ..
 popd
 
 make %{?_smp_mflags} -C %{_target_platform}
@@ -81,10 +94,8 @@ rm -rf %{buildroot}
 
 
 %post -p /sbin/ldconfig
-
 %postun -p /sbin/ldconfig
 
-
 %files
 %defattr(-,root,root,-)
 %doc AUTHORS COPYING README
@@ -110,9 +121,12 @@ rm -rf %{buildroot}
 %defattr(-,root,root,-)
 %doc html/*
 
+
 %changelog
-* Sun Dec 11 2011 Rex Dieter <rdieter at fedoraproject.org> 0.99.0-3
+* Mon Dec 12 2011 Rex Dieter <rdieter at fedoraproject.org> 0.99.0-3
 - upstream crash patch (kde#258916,#684625)
+- pull a couple more upstream patches
+- -devel: drop Req: polkit-devel
 
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.99.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild


More information about the scm-commits mailing list