rpms/hal/devel hal-ck-api-change.patch, NONE, 1.1 hal.spec, 1.158, 1.159

William Jon McCann (mccann) fedora-extras-commits at redhat.com
Tue Jul 22 23:12:22 UTC 2008


Author: mccann

Update of /cvs/pkgs/rpms/hal/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26680/devel

Modified Files:
	hal.spec 
Added Files:
	hal-ck-api-change.patch 
Log Message:
- Fix for CK API changes



hal-ck-api-change.patch:

--- NEW FILE hal-ck-api-change.patch ---
diff --git a/hald/ck-tracker.c b/hald/ck-tracker.c
index 34aa640..7574e76 100644
--- a/hald/ck-tracker.c
+++ b/hald/ck-tracker.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /***************************************************************************
  * CVSID: $Id$
  *
@@ -255,11 +256,17 @@ ck_session_get_info (CKTracker *tracker, CKSession *session)
 			dbus_message_unref (reply);
 		goto error;
 	}
+	/* GetUnixUser API Changed in CK 0.3.0 */
 	if (!dbus_message_get_args (reply, NULL,
-				    DBUS_TYPE_INT32, &(session->user),
+				    DBUS_TYPE_UINT32, &(session->user),
 				    DBUS_TYPE_INVALID)) {
-		HAL_ERROR (("Invalid GetUnixUser reply from CK"));
-		goto error;
+		/* try the older API */
+		if (!dbus_message_get_args (reply, NULL,
+					    DBUS_TYPE_INT32, &(session->user),
+					    DBUS_TYPE_INVALID)) {
+			HAL_ERROR (("Invalid GetUnixUser reply from CK"));
+			goto error;
+		}
 	}
 	dbus_message_unref (message);
 	dbus_message_unref (reply);
@@ -530,11 +537,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
 
 		seat_objpath = dbus_message_get_path (message);
 
+		/* API fixed in CK 0.3 to match spec */
 		if (!dbus_message_get_args (message, NULL,
-					    DBUS_TYPE_STRING, &seat_objpath,
+					    DBUS_TYPE_OBJECT_PATH, &seat_objpath,
 					    DBUS_TYPE_INVALID)) {
-			HAL_ERROR (("Invalid SeatAdded signal from CK"));
-			goto out;
+			if (!dbus_message_get_args (message, NULL,
+						    DBUS_TYPE_STRING, &seat_objpath,
+						    DBUS_TYPE_INVALID)) {
+				HAL_ERROR (("Invalid SeatAdded signal from CK"));
+				goto out;
+			}
 		}
 
 		HAL_INFO (("Received SeatAdded '%s' from CK", seat_objpath));
@@ -557,11 +569,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
 
 		seat_objpath = dbus_message_get_path (message);
 
+		/* API fixed in CK 0.3 to match spec */
 		if (!dbus_message_get_args (message, NULL,
-					    DBUS_TYPE_STRING, &seat_objpath,
+					    DBUS_TYPE_OBJECT_PATH, &seat_objpath,
 					    DBUS_TYPE_INVALID)) {
-			HAL_ERROR (("Invalid SeatRemoved signal from CK"));
-			goto out;
+			if (!dbus_message_get_args (message, NULL,
+						    DBUS_TYPE_STRING, &seat_objpath,
+						    DBUS_TYPE_INVALID)) {
+				HAL_ERROR (("Invalid SeatRemoved signal from CK"));
+				goto out;
+			}
 		}
 
 		HAL_INFO (("Received SeatRemoved '%s' from CK", seat_objpath));
@@ -587,11 +604,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
 
 		seat_objpath = dbus_message_get_path (message);
 
+		/* API fixed in CK 0.3 to match spec */
 		if (!dbus_message_get_args (message, NULL,
-					    DBUS_TYPE_STRING, &session_objpath,
+					    DBUS_TYPE_OBJECT_PATH, &session_objpath,
 					    DBUS_TYPE_INVALID)) {
-			HAL_ERROR (("Invalid SessionAdded signal from CK"));
-			goto out;
+			if (!dbus_message_get_args (message, NULL,
+						    DBUS_TYPE_STRING, &session_objpath,
+						    DBUS_TYPE_INVALID)) {
+				HAL_ERROR (("Invalid SessionAdded signal from CK"));
+				goto out;
+			}
 		}
 
 		HAL_INFO (("Received SessionAdded '%s' from CK on seat '%s'", session_objpath, seat_objpath));
@@ -623,11 +645,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
 
 		seat_objpath = dbus_message_get_path (message);
 
+		/* API fixed in CK 0.3 to match spec */
 		if (!dbus_message_get_args (message, NULL,
-					    DBUS_TYPE_STRING, &session_objpath,
+					    DBUS_TYPE_OBJECT_PATH, &session_objpath,
 					    DBUS_TYPE_INVALID)) {
-			HAL_ERROR (("Invalid SessionRemoved signal from CK"));
-			goto out;
+			if (!dbus_message_get_args (message, NULL,
+						    DBUS_TYPE_STRING, &session_objpath,
+						    DBUS_TYPE_INVALID)) {
+				HAL_ERROR (("Invalid SessionRemoved signal from CK"));
+				goto out;
+			}
 		}
 
 		HAL_INFO (("Received SessionRemoved '%s' from CK on seat '%s'", session_objpath, seat_objpath));


Index: hal.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hal/devel/hal.spec,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- hal.spec	12 Jun 2008 14:34:59 -0000	1.158
+++ hal.spec	22 Jul 2008 23:11:28 -0000	1.159
@@ -26,12 +26,13 @@
 Summary: Hardware Abstraction Layer
 Name: hal
 Version: 0.5.11
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://www.freedesktop.org/Software/hal
 Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
 Patch1: hal-0.5.10-set-property-direct.patch
 Patch2: hal-change-priority.patch
 Patch3: hal-cloexec.patch
+Patch4: hal-ck-api-change.patch
 License: AFL or GPLv2
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
@@ -128,6 +129,7 @@
 %patch1 -p1 -b .direct
 %patch2 -p1 -b .priority
 %patch3 -p1 -b .selinux-leak
+%patch4 -p1 -b .api-change
 
 %build
 autoreconf
@@ -272,6 +274,9 @@
 %{_datadir}/gtk-doc/html/libhal-storage/*
 
 %changelog
+* Tue Jul 22 2008 Jon McCann  <jmccann at redhat.com> - 0.5.11-3
+- Fix for CK API changes
+
 * Thu Jun 12 2008 Richard Hughes <rhughes at redhat.com> - 0.5.11-2
 - Fix unmounting of USB drives when using SELinux due to a leaking file
   descriptor (#447195)




More information about the fedora-extras-commits mailing list