1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## firefox_iceweasel_rename.dpatch by <ct@piglets.com>
4
## DP: The OpenSearch plugin searches for firefox search plugins,
5
## DP: but of course, on a Debian system this is to be found under
6
## DP: iceweasel, not firefox.
8
## DP: This patch also makes the Firefox bookmarks plugin index
9
## DP: Iceweasel bookmarks.
12
diff -urNad gnome-do-plugins-0.8.2+dfsg~/Firefox/src/PlacesItemSource.cs gnome-do-plugins-0.8.2+dfsg/Firefox/src/PlacesItemSource.cs
13
--- gnome-do-plugins-0.8.2+dfsg~/Firefox/src/PlacesItemSource.cs 2009-06-23 11:00:43.000000000 +1000
14
+++ gnome-do-plugins-0.8.2+dfsg/Firefox/src/PlacesItemSource.cs 2009-06-28 20:52:39.596179763 +1000
17
home = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
19
- path = Path.Combine (home, ".mozilla/firefox/profiles.ini");
20
- using (StreamReader r = File.OpenText (path)) {
21
+ path = Path.Combine (home, ".mozilla");
22
+ if (Directory.Exists (Path.Combine (path, "firefox"))) {
23
+ path = Path.Combine (path, "firefox");
24
+ } else if (Directory.Exists (Path.Combine (path, "iceweasel"))) {
25
+ path = Path.Combine (path, "iceweasel");
27
+ using (StreamReader r = File.OpenText (Path.Combine (path, "profiles.ini"))) {
28
while ((line = r.ReadLine ()) != null) {
29
if (line.StartsWith (BeginDefaultProfile)) {
35
- return new [] {home, ".mozilla", "firefox", profile}.Aggregate (Path.Combine);
36
+ return Path.Combine (path, profile);
40
diff -urNad gnome-do-plugins-0.8.2+dfsg~/OpenSearch/src/FirefoxOpenSearchDirectoryProvider.cs gnome-do-plugins-0.8.2+dfsg/OpenSearch/src/FirefoxOpenSearchDirectoryProvider.cs
41
--- gnome-do-plugins-0.8.2+dfsg~/OpenSearch/src/FirefoxOpenSearchDirectoryProvider.cs 2009-06-23 11:00:43.000000000 +1000
42
+++ gnome-do-plugins-0.8.2+dfsg/OpenSearch/src/FirefoxOpenSearchDirectoryProvider.cs 2009-06-28 20:38:51.032212068 +1000
45
public class FirefoxOpenSearchDirectoryProvider
47
+ private static string firefoxPath = "/usr/bin/firefox";
48
+ private static string iceweaselPath = "/usr/bin/iceweasel";
50
private List<string> openSearchPluginDirectories;
54
// for installing in different directories. We could certainly shell
55
// out and call which or something...
56
string beginLibDir = "LIBDIR=";
57
- string binFile = "/usr/bin/firefox";
58
+ string binFile = "";
63
+ if (File.Exists (firefoxPath)) {
64
+ binFile = firefoxPath;
65
+ } else if (File.Exists (iceweaselPath)) {
66
+ binFile = iceweaselPath;
69
using (StreamReader r = File.OpenText (binFile)) {
70
while (null != (line = r.ReadLine ())) {
71
if (line.StartsWith (beginLibDir)) {
76
+ private string UserBrowserPath {
78
+ string mozillaPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".mozilla");
79
+ if (Directory.Exists (Path.Combine (mozillaPath, "firefox"))) {
80
+ mozillaPath = Path.Combine (mozillaPath, "firefox");
81
+ } else if (Directory.Exists (Path.Combine (mozillaPath, "iceweasel"))) {
82
+ mozillaPath = Path.Combine (mozillaPath, "iceweasel");
89
/// Retrieves the profile plugin directory, which is where the
90
/// user installed OpenSearch plugins are located.
95
- profilePath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".mozilla/firefox/profiles.ini");
96
+ profilePath = Path.Combine (UserBrowserPath, "profiles.ini");
97
using (StreamReader r = File.OpenText (profilePath)) {
98
while (null != (line = r.ReadLine ())) {
99
if (line.StartsWith (beginDefaultProfile)) break;
103
if(profile != null) {
104
- string path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".mozilla/firefox");
105
+ string path = UserBrowserPath;
106
path = Path.Combine (path, profile);
107
path = Path.Combine (path, "searchplugins");