Patch: Debian binary detection fix
- From: Pascal de Bruijn <pmjdebruijn pcode nl>
- To: gnome-color-manager-list gnome org
- Subject: Patch: Debian binary detection fix
- Date: Thu, 26 Nov 2009 21:54:28 +0100
Hi,
I noticed the following recent commit to detect the Debinized Argyll binaries:
http://git.gnome.org/cgit/gnome-color-manager/commit/?id=3b06571386be55a7b21424c256b88b2fb2ec6347
Conceptually the commit is fine, it's particularly great, this detect
method is used for all of Argyll's utilities. Practically this is only
applicable for targen at the moment. But since it's used for all
binaries, gcm is automatically future proofed against other binaries
getting renamed as well. Excellent behaviour.
However, the detection is backwards. Please allow me to explain.
Debian maintainers don't rename binaries just because they get a kick
out of arbitrarily renaming random binaries. Debian has problems with
conflicting binaries because their package repository is so big
(almost 30,000 packages). This means they are forced to rename
binaries in all but one package with conflicting binaries.
This implies, on systems with a 'argyll-targen' binary, a 'targen'
binary could be installed as well. But if a 'targen' binary is
installed as well, it's most likely completely unrelated to Argyll,
and will almost certainly fail when called by gcm.
Therefore the detect should _first_ detect if the Debian renamed
binaries exist, and if not, fallback to the original binary names.
I've attached a small patch, which should "fix" the issue described above.
Regards,
Pascal de Bruijn
diff -Nurpd gnome-color-manager-orig/src/gcm-calibrate.c gnome-color-manager-debian/src/gcm-calibrate.c
--- gnome-color-manager-orig/src/gcm-calibrate.c 2009-11-26 18:15:28.000000000 +0100
+++ gnome-color-manager-debian/src/gcm-calibrate.c 2009-11-26 21:43:22.000000000 +0100
@@ -323,19 +323,19 @@ gcm_calibrate_get_tool_filename (const g
gboolean ret;
gchar *filename;
+ /* try the debian one */
+ g_free (filename);
+ filename = g_strdup_printf ("/usr/bin/argyll-%s", command);
+ ret = g_file_test (filename, G_FILE_TEST_EXISTS);
+ if (ret)
+ goto out;
+
/* test original argyllcms name */
filename = g_strdup_printf ("/usr/bin/%s", command);
ret = g_file_test (filename, G_FILE_TEST_EXISTS);
if (ret)
goto out;
- /* try the debian one */
- g_free (filename);
- filename = g_strdup_printf ("/usr/bin/argyll-%s", command);
- ret = g_file_test (filename, G_FILE_TEST_EXISTS);
- if (ret)
- goto out;
-
/* eek */
g_free (filename);
filename = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]