[gnome-color-manager/f18] Fix calibration when using new versions of ArgyllCMS

Richard Hughes rhughes at fedoraproject.org
Thu Dec 5 19:52:34 UTC 2013


commit af0bdb88b77cd6606725998da9eda4a3548e7dfe
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Dec 5 19:38:50 2013 +0000

    Fix calibration when using new versions of ArgyllCMS

 0001-Make-it-work-with-dispcal-using-stderr.patch |   67 +++++++++++++++++++++
 gnome-color-manager.spec                          |    9 +++-
 2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/0001-Make-it-work-with-dispcal-using-stderr.patch b/0001-Make-it-work-with-dispcal-using-stderr.patch
new file mode 100644
index 0000000..6928e96
--- /dev/null
+++ b/0001-Make-it-work-with-dispcal-using-stderr.patch
@@ -0,0 +1,67 @@
+From d37843ea6a25d62509aba887fb50e333e63c254a Mon Sep 17 00:00:00 2001
+From: Patryk Zawadzki <patrys at room-303.com>
+Date: Thu, 5 Dec 2013 16:41:41 +0100
+Subject: [PATCH] Make it work with dispcal using stderr
+
+Signed-off-by: Richard Hughes <richard at hughsie.com>
+---
+ src/gcm-calibrate-argyll.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
+index 2bb402c..fd52586 100644
+--- a/src/gcm-calibrate-argyll.c
++++ b/src/gcm-calibrate-argyll.c
+@@ -160,7 +160,9 @@ gcm_calibrate_argyll_get_display (const gchar *output_name,
+ {
+ 	gboolean ret = FALSE;
+ 	gchar *command = NULL;
+-	gchar *data = NULL;
++	const gchar *data;
++	gchar *data_stderr = NULL;
++	gchar *data_stdout = NULL;
+ 	gchar *name;
+ 	gchar **split = NULL;
+ 	gint exit_status;
+@@ -174,13 +176,26 @@ gcm_calibrate_argyll_get_display (const gchar *output_name,
+ 
+ 	/* execute it and capture stderr */
+ 	ret = g_spawn_command_line_sync (command,
+-					 NULL,
+-					 &data,
++					 &data_stdout,
++					 &data_stderr,
+ 					 &exit_status,
+ 					 error);
+ 	if (!ret)
+ 		goto out;
+ 
++	/* recent versions of dispcal switched to stderr output */
++	if (data_stdout != NULL && data_stdout[0] != '\0') {
++		data = data_stdout;
++	} else if (data_stderr != NULL && data_stderr[0] != '\0') {
++		data = data_stderr;
++	} else {
++		g_set_error_literal (error,
++				     GCM_CALIBRATE_ERROR,
++				     GCM_CALIBRATE_ERROR_INTERNAL,
++				     "no sensible output from dispcal");
++		goto out;
++	}
++
+ 	/* split it into lines */
+ 	split = g_strsplit (data, "\n", -1);
+ 	for (i=0; split[i] != NULL; i++) {
+@@ -210,7 +225,8 @@ gcm_calibrate_argyll_get_display (const gchar *output_name,
+ 	}
+ out:
+ 	g_free (command);
+-	g_free (data);
++	g_free (data_stdout);
++	g_free (data_stderr);
+ 	g_strfreev (split);
+ 	return display;
+ }
+-- 
+1.8.4.2
+
diff --git a/gnome-color-manager.spec b/gnome-color-manager.spec
index b8e21bb..80474c6 100644
--- a/gnome-color-manager.spec
+++ b/gnome-color-manager.spec
@@ -1,12 +1,15 @@
 Summary:   Color management tools for GNOME
 Name:      gnome-color-manager
 Version:   3.6.1
-Release:   1%{?dist}
+Release:   2%{?dist}
 License:   GPLv2+
 Group:     Applications/System
 URL:       http://projects.gnome.org/gnome-color-manager/
 Source0:   http://download.gnome.org/sources/gnome-color-manager/3.5/%{name}-%{version}.tar.xz
 
+# Upstream already
+Patch0:    0001-Make-it-work-with-dispcal-using-stderr.patch
+
 Requires:  color-filesystem >= 1-7
 Requires:  gnome-icon-theme
 Requires:  shared-mime-info
@@ -57,6 +60,7 @@ and generate color profiles in the GNOME desktop.
 
 %prep
 %setup -q
+%patch0 -p1 -b .fix-with-new-argyllcms
 
 %build
 %configure --disable-scrollkeeper --disable-schemas-install
@@ -111,6 +115,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_datadir}/applications/gcm-*.desktop
 
 %changelog
+* Thu Dec 05 2013 Richard Hughes <rhughes at redhat.com> - 3.6.1-2
+- Fix calibration when using new versions of ArgyllCMS
+
 * Thu Jan 10 2013 Richard Hughes <hughsient at gmail.com> - 3.6.1-1
 - Update to 3.6.1
 


More information about the scm-commits mailing list