Merge lp:~jazzva/nspluginwrapper/ubuntu.1.2.2-0ubuntu3 into lp:nspluginwrapper

Proposed by Saša Bodiroža
Status: Merged
Approved by: Alexander Sack
Approved revision: 58
Merged at revision: not available
Proposed branch: lp:~jazzva/nspluginwrapper/ubuntu.1.2.2-0ubuntu3
Merge into: lp:nspluginwrapper
Diff against target: None lines
To merge this branch: bzr merge lp:~jazzva/nspluginwrapper/ubuntu.1.2.2-0ubuntu3
Reviewer Review Type Date Requested Status
Alexander Sack (community) Approve
Review via email: mp+5146@code.launchpad.net

This proposal supersedes a proposal from 2009-04-02.

To post a comment you must log in.
Revision history for this message
Alexander Sack (asac) wrote :

looks good i will merge this now. Consider to not do variable declaration in the middle of code, but at the top of the function/block instead (e.g. better portable).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2009-03-19 20:51:41 +0000
+++ debian/changelog 2009-04-02 14:38:21 +0000
@@ -1,3 +1,11 @@
1nspluginwrapper (1.2.2-0ubuntu3) jaunty; urgency=low
2
3 * Add patch debian/patches/005_process_env_dirs.diff to process directories
4 specified in environment variable NSPLUGIN_DIRS (see patch for more info)
5 (LP: #345606)
6
7 -- Sasa Bodiroza <jazzva@gmail.com> Thu, 02 Apr 2009 16:37:59 +0200
8
1nspluginwrapper (1.2.2-0ubuntu2) jaunty; urgency=low9nspluginwrapper (1.2.2-0ubuntu2) jaunty; urgency=low
210
3 * Remove Iceweasel dir from debian/patches/000_debian_make_symlinks.diff11 * Remove Iceweasel dir from debian/patches/000_debian_make_symlinks.diff
412
=== added file 'debian/patches/005_process_env_dirs.diff'
--- debian/patches/005_process_env_dirs.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/005_process_env_dirs.diff 2009-04-02 14:37:55 +0000
@@ -0,0 +1,88 @@
1Implement get_env_plugin_dirs() to return a list of directory names
2specified by environment variable NSPLUGIN_DIRS.
3Adjust get_mozilla_plugin_dirs() to append the mentioned list at the end.
4Adjust npconfig_CFLAGS in Makefile to include glib during compile.
5
6 -- Sasa Bodiroza <jazzva@gmail.com> Wed, 01 Apr 2009 21:50:00 +0200
7Index: ubuntu.1.2.2-0ubuntu3/src/npw-config.c
8===================================================================
9--- ubuntu.1.2.2-0ubuntu3.orig/src/npw-config.c 2009-04-02 16:29:55.000000000 +0200
10+++ ubuntu.1.2.2-0ubuntu3/src/npw-config.c 2009-04-02 16:32:56.000000000 +0200
11@@ -38,6 +38,7 @@
12 #include <pwd.h>
13 #include <dirent.h>
14
15+#include <glib.h>
16
17 static bool g_auto = false;
18 static bool g_verbose = false;
19@@ -213,6 +214,21 @@
20 return plugin_path;
21 }
22
23+const gchar **get_env_plugin_dirs(int *count)
24+{
25+ char *ns_plugin_dir = getenv("NSPLUGIN_DIRS");
26+ if (ns_plugin_dir == NULL)
27+ return NULL;
28+ *count = 0;
29+ const gchar **ns_plugin_dirs = g_strsplit((gchar *)ns_plugin_dir, ":", -1);
30+ const gchar **iter = ns_plugin_dirs;
31+ while (*iter) {
32+ (*count)++;
33+ iter++;
34+ }
35+ return ns_plugin_dirs;
36+}
37+
38 static const char **get_mozilla_plugin_dirs(void)
39 {
40 static const char *default_dirs[] = {
41@@ -257,13 +273,23 @@
42 };
43
44 const int n_default_dirs = (sizeof(default_dirs) / sizeof(default_dirs[0]));
45- const char **dirs = malloc((n_default_dirs + 2) * sizeof(dirs[0]));
46+ int n_env_dirs;
47+ const gchar **env_dirs = get_env_plugin_dirs(&n_env_dirs);
48+ const char **dirs = malloc((n_default_dirs + n_env_dirs + 2) * sizeof(dirs[0]));
49 int i, j;
50 for (i = 0, j = 0; i < n_default_dirs; i++) {
51 const char *dir = default_dirs[i];
52 if (dir && access(dir, F_OK) == 0)
53 dirs[j++] = dir;
54 }
55+ if (env_dirs) {
56+ const gchar **iter = env_dirs;
57+ while (*iter) {
58+ if (*iter && access(*iter, F_OK) == 0)
59+ dirs[j++] = (char *)*iter;
60+ iter++;
61+ }
62+ }
63 dirs[j++] = get_user_mozilla_plugin_dir();
64 dirs[j] = NULL;
65 return dirs;
66Index: ubuntu.1.2.2-0ubuntu3/Makefile
67===================================================================
68--- ubuntu.1.2.2-0ubuntu3.orig/Makefile 2009-04-02 16:29:55.000000000 +0200
69+++ ubuntu.1.2.2-0ubuntu3/Makefile 2009-04-02 16:29:55.000000000 +0200
70@@ -174,7 +174,8 @@
71 npconfig_RAWSRCS = npw-config.c
72 npconfig_SOURCES = $(npconfig_RAWSRCS:%.c=$(SRC_PATH)/src/%.c)
73 npconfig_OBJECTS = $(npconfig_RAWSRCS:%.c=npconfig-%.o)
74-npconfig_LDFLAGS = $(libdl_LDFLAGS)
75+npconfig_CFLAGS = $(GLIB_CFLAGS)
76+npconfig_LDFLAGS = $(GLIB_LDFLAGS) $(libdl_LDFLAGS)
77 ifneq (,$(findstring $(OS),netbsd dragonfly))
78 # We will try to dlopen() the native plugin library. If that lib is
79 # linked against libpthread, then so must our program too.
80@@ -410,7 +411,7 @@
81 $(CC) -o $@ $(npconfig_OBJECTS) $(npconfig_LDFLAGS)
82
83 npconfig-%.o: $(SRC_PATH)/src/%.c
84- $(CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS)
85+ $(CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS) $(npconfig_CFLAGS)
86
87 $(nploader_PROGRAM): $(nploader_SOURCES)
88 sed -e "s|%NPW_LIBDIR%|$(pkglibdir)|" $< > $@
089
=== modified file 'debian/patches/series'
--- debian/patches/series 2008-12-15 22:09:17 +0000
+++ debian/patches/series 2009-04-01 20:10:03 +0000
@@ -3,3 +3,4 @@
3002_install_to_NSPLUGINDIR.diff3002_install_to_NSPLUGINDIR.diff
4003_update_help_info.diff4003_update_help_info.diff
5004_fix_threading.diff5004_fix_threading.diff
6005_process_env_dirs.diff

Subscribers

People subscribed via source and target branches

to all changes: