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

Subscribers

People subscribed via source and target branches

to all changes: