rpms/DeviceKit-power/F-11 DeviceKit-power-007-make-suspend-sync.patch, NONE, 1.1 DeviceKit-power.spec, 1.11, 1.12 DeviceKit-power-007-fix-compile.patch, 1.1, NONE

Richard Hughes rhughes at fedoraproject.org
Sat Apr 25 10:16:37 UTC 2009


Author: rhughes

Update of /cvs/pkgs/rpms/DeviceKit-power/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv979

Modified Files:
	DeviceKit-power.spec 
Added Files:
	DeviceKit-power-007-make-suspend-sync.patch 
Removed Files:
	DeviceKit-power-007-fix-compile.patch 
Log Message:
* Sat Apr 25 2009 Richard Hughes  <rhughes at redhat.com> - 008-0.2.20090401git
- Backport a trivial patch from upstream to make the suspend and hibernate
  scripts execute synchronously, which makes the unlock dialog do the right
  thing on resume.
- Fixes rh#497563


DeviceKit-power-007-make-suspend-sync.patch:

--- NEW FILE DeviceKit-power-007-make-suspend-sync.patch ---
commit 6b197ebd5e0f914071a03f5e3da21e9045df12bc
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Apr 25 11:06:52 2009 +0100

    Make the suspend and hibernate scripts execute synchronously. Fixes rh#497563

diff --git a/src/dkp-daemon.c b/src/dkp-daemon.c
index fdcd21e..bcc6504 100644
--- a/src/dkp-daemon.c
+++ b/src/dkp-daemon.c
@@ -624,6 +624,8 @@ dkp_daemon_suspend (DkpDaemon *daemon, DBusGMethodInvocation *context)
 	GError *error;
 	GError *error_local = NULL;
 	PolKitCaller *caller;
+	gchar *stdout = NULL;
+	gchar *stderr = NULL;
 
 	caller = dkp_polkit_get_caller (daemon->priv->polkit, context);
 	if (caller == NULL)
@@ -632,17 +634,19 @@ dkp_daemon_suspend (DkpDaemon *daemon, DBusGMethodInvocation *context)
 	if (!dkp_polkit_check_auth (daemon->priv->polkit, caller, "org.freedesktop.devicekit.power.suspend", context))
 		goto out;
 
-	ret = g_spawn_command_line_async ("/usr/sbin/pm-suspend", &error_local);
+	ret = g_spawn_command_line_sync ("/usr/sbin/pm-suspend", &stdout, &stderr, NULL, &error_local);
 	if (!ret) {
 		error = g_error_new (DKP_DAEMON_ERROR,
 				     DKP_DAEMON_ERROR_GENERAL,
-				     "Cannot spawn: %s", error_local->message);
+				     "Failed to spawn: %s, stdout:%s, stderr:%s", error_local->message, stdout, stderr);
 		g_error_free (error_local);
 		dbus_g_method_return_error (context, error);
 		goto out;
 	}
 	dbus_g_method_return (context, NULL);
 out:
+	g_free (stdout);
+	g_free (stderr);
 	if (caller != NULL)
 		polkit_caller_unref (caller);
 	return TRUE;
@@ -658,6 +662,8 @@ dkp_daemon_hibernate (DkpDaemon *daemon, DBusGMethodInvocation *context)
 	GError *error;
 	GError *error_local = NULL;
 	PolKitCaller *caller;
+	gchar *stdout = NULL;
+	gchar *stderr = NULL;
 
 	caller = dkp_polkit_get_caller (daemon->priv->polkit, context);
 	if (caller == NULL)
@@ -666,17 +672,19 @@ dkp_daemon_hibernate (DkpDaemon *daemon, DBusGMethodInvocation *context)
 	if (!dkp_polkit_check_auth (daemon->priv->polkit, caller, "org.freedesktop.devicekit.power.hibernate", context))
 		goto out;
 
-	ret = g_spawn_command_line_async ("/usr/sbin/pm-hibernate", &error_local);
+	ret = g_spawn_command_line_sync ("/usr/sbin/pm-hibernate", &stdout, &stderr, NULL, &error_local);
 	if (!ret) {
 		error = g_error_new (DKP_DAEMON_ERROR,
 				     DKP_DAEMON_ERROR_GENERAL,
-				     "Cannot spawn: %s", error_local->message);
+				     "Failed to spawn: %s, stdout:%s, stderr:%s", error_local->message, stdout, stderr);
 		g_error_free (error_local);
 		dbus_g_method_return_error (context, error);
 		goto out;
 	}
 	dbus_g_method_return (context, NULL);
 out:
+	g_free (stdout);
+	g_free (stderr);
 	if (caller != NULL)
 		polkit_caller_unref (caller);
 	return TRUE;


Index: DeviceKit-power.spec
===================================================================
RCS file: /cvs/pkgs/rpms/DeviceKit-power/F-11/DeviceKit-power.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DeviceKit-power.spec	1 Apr 2009 08:29:22 -0000	1.11
+++ DeviceKit-power.spec	25 Apr 2009 10:16:07 -0000	1.12
@@ -9,7 +9,7 @@
 Summary: Power Management Service
 Name: DeviceKit-power
 Version: 008
-Release: 0.1.%{?alphatag}git%{?dist}
+Release: 0.2.%{?alphatag}git%{?dist}
 #Release: 2%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
@@ -17,6 +17,9 @@
 Source0:   http://hal.freedesktop.org/releases/%{name}-%{version}-%{?alphatag}.tar.gz
 #Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
 
+# Already upstream: 6b197ebd5e0f914071a03f5e3da21e9045df12bc
+Patch0:    DeviceKit-power-007-make-suspend-sync.patch
+
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -54,6 +57,7 @@
 %prep
 #%setup -q
 %setup -q -n %{?name}-%{?version}-%{?alphatag}
+%patch0 -p1 -b .suspend-sync
 
 %build
 %configure
@@ -111,6 +115,12 @@
 %{_libdir}/pkgconfig/*.pc
 
 %changelog
+* Sat Apr 25 2009 Richard Hughes  <rhughes at redhat.com> - 008-0.2.20090401git
+- Backport a trivial patch from upstream to make the suspend and hibernate
+  scripts execute synchronously, which makes the unlock dialog do the right
+  thing on resume.
+- Fixes rh#497563
+
 * Tue Apr 01 2009 Richard Hughes  <rhughes at redhat.com> - 008-0.1.20090401git
 - Update to todays git snapshot which works with the new permissive DBus.
 


--- DeviceKit-power-007-fix-compile.patch DELETED ---




More information about the scm-commits mailing list