summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@ubuntu.com>2010-01-12 00:06:17 +0100
committerBenjamin Drung <bdrung@ubuntu.com>2010-01-12 00:06:17 +0100
commit7a56de1e876fdcc813396a1ddeb5d0584384a02f (patch)
tree0eed18fd8b2133525a499786326a5b880c044a36 /src
parent7d5ba16f8f933d490a413e3145c20867ccde4627 (diff)
- create additional symlinks for icedove and thunderbird, because they do
not scan /usr/{lib,share}/mozilla/extensions/$target_application - update src/install-xpi
Diffstat (limited to 'src')
-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]