~ubuntu-branches/ubuntu/quantal/thunar/quantal-proposed

« back to all changes in this revision

Viewing changes to debian/patches/01_support-non-multiarch-modules.patch

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez, Yves-Alexis Perez, Lionel Le Folgoc
  • Date: 2011-10-14 18:47:39 UTC
  • mto: (2.1.7 experimental)
  • mto: This revision was merged to the branch mainline in revision 81.
  • Revision ID: james.westby@ubuntu.com-20111014184739-8trk4sn47wu6td2u
[ Yves-Alexis Perez ]
* debian/rules:
  - re-add -z,defs to LDFLAGS.
* debian/control:
  - only recommends thunar-volman on linux arches.

[ Lionel Le Folgoc ]
* debian/patches/01_support-non-multiarch-modules.patch: support modules
  installed in /usr/lib/$triplet and /usr/lib, to hopefully migrate smoothly
  thunar plugins to multiarch path over time without breakage. Closes: #645015

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 6376360bd33778c751d878a1c722fcaedbe69512 Mon Sep 17 00:00:00 2001
 
2
From: Lionel Le Folgoc <lionel@lefolgoc.net>
 
3
Date: Tue, 11 Oct 2011 21:30:17 +0200
 
4
Subject: Look for plugins in {non-,}multiarch THUNARX_DIRECTORY
 
5
 
 
6
This will let a multiarch enabled libthunarx find plugins built against a
 
7
non-multiarch thunar (load plugins from both /usr/lib/$triplet and /usr/lib).
 
8
---
 
9
 thunarx/thunarx-provider-factory.c |   12 +++++++++++-
 
10
 thunarx/thunarx-provider-module.c  |    6 ++++++
 
11
 2 files changed, 17 insertions(+), 1 deletions(-)
 
12
 
 
13
diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c
 
14
index f2588eb..cbcf642 100644
 
15
--- a/thunarx/thunarx-provider-factory.c
 
16
+++ b/thunarx/thunarx-provider-factory.c
 
17
@@ -145,8 +145,17 @@ thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory)
 
18
   GList                 *modules = NULL;
 
19
   GList                 *lp;
 
20
   GDir                  *dp;
 
21
+  gsize                  i;
 
22
+  const gchar           *thunarx_dirs[] =
 
23
+                          {
 
24
+                            THUNARX_DIRECTORY,
 
25
+                            "/usr/lib/thunarx-2"
 
26
+                          };
 
27
 
 
28
-  dp = g_dir_open (THUNARX_DIRECTORY, 0, NULL);
 
29
+  /* Search both multiarch and non-multiarch THUNARX_DIRECTORYs */
 
30
+  for (i = 0; i < G_N_ELEMENTS (thunarx_dirs); ++i)
 
31
+  {
 
32
+  dp = g_dir_open (thunarx_dirs[i], 0, NULL);
 
33
   if (G_LIKELY (dp != NULL))
 
34
     {
 
35
       /* determine the types for all existing plugins */
 
36
@@ -192,6 +201,7 @@ thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory)
 
37
 
 
38
       g_dir_close (dp);
 
39
     }
 
40
+  }
 
41
 
 
42
   return modules;
 
43
 }
 
44
diff --git a/thunarx/thunarx-provider-module.c b/thunarx/thunarx-provider-module.c
 
45
index 4f96ffd..dbb693b 100644
 
46
--- a/thunarx/thunarx-provider-module.c
 
47
+++ b/thunarx/thunarx-provider-module.c
 
48
@@ -178,6 +178,12 @@ thunarx_provider_module_load (GTypeModule *type_module)
 
49
 
 
50
   /* load the module using the runtime link editor */
 
51
   path = g_build_filename (THUNARX_DIRECTORY, type_module->name, NULL);
 
52
+  if (!g_file_test (path, G_FILE_TEST_EXISTS))
 
53
+    {
 
54
+      /* if it doesn't exist in the default dir, try non-multiarch THUNARX_DIRECTORY */
 
55
+      g_free (path);
 
56
+      path = g_build_filename ("/usr/lib/thunarx-2", type_module->name, NULL);
 
57
+    }
 
58
   module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
 
59
   g_free (path);
 
60
 
 
61
-- 
 
62
1.7.7
 
63