summaryrefslogtreecommitdiff
path: root/src/install-xpi
diff options
context:
space:
mode:
Diffstat (limited to 'src/install-xpi')
-rwxr-xr-xsrc/install-xpi23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/install-xpi b/src/install-xpi
index 9ee6a7c..ade3f73 100755
--- a/src/install-xpi
+++ b/src/install-xpi
@@ -20,6 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
+import csv
import getopt
import os
import stat
@@ -68,6 +69,23 @@ def get_mode(filename):
mode = st[stat.ST_MODE]
return mode & 0777
+def get_xul_apps():
+ csvfile = open("/usr/share/mozilla-devscripts/xul-app-data.csv")
+ csv_reader = csv.DictReader(csvfile)
+ rows = []
+ for row in csv_reader:
+ rows.append(row)
+ return rows
+
+def incompatible_apps(target_applications):
+ """There are still some application that do not scan
+ "/usr/{lib,share}/mozilla/extensions/$target_application" for extensions."""
+ xul_apps = filter(lambda x: x["id"] in target_applications, get_xul_apps())
+ app_list = reduce(lambda l, x: l + [x["package"]], xul_apps, list())
+ incompatible_apps = ["icedove", "thunderbird"]
+ incompatible_apps = filter(lambda x: x in app_list, incompatible_apps)
+ return incompatible_apps
+
def install_xpi(script_name, package, xpi_file, exclude, install_dir, links, correct_permissions, remove_licenses, verbose=False):
# get xpi file content list
if not os.path.isfile(xpi_file):
@@ -134,6 +152,11 @@ def install_xpi(script_name, package, xpi_file, exclude, install_dir, links, cor
target_application, extension_id)
links.add(destination)
+ # backwards compatibility: create symlinks for applications that do not
+ # scan /usr/{lib,share}/mozilla/extensions/target_application for extensions
+ for app in incompatible_apps(target_applications):
+ links.add(os.path.join("/usr/lib", app, "extensions", extension_id))
+
# create symlinks
for link in links:
command = ["dh_link", "-p" + package, install_dir, link]