summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@ubuntu.com>2010-04-11 20:44:30 +0200
committerBenjamin Drung <bdrung@ubuntu.com>2010-04-11 20:44:30 +0200
commite154039bd85e7ed44ca66593bc41f7e5dc754823 (patch)
tree0a3d40588efc883d59fef6d99b25f5f28a669377 /src
parent8d3591e114f96bb5b2406dc6d76b2dbf789d2f95 (diff)
* Use debian/package.js as configuration file if it exists.
- update man/install-xpi.1 - update src/install-xpi
Diffstat (limited to 'src')
-rwxr-xr-xsrc/install-xpi13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/install-xpi b/src/install-xpi
index 9b22644..61771e9 100755
--- a/src/install-xpi
+++ b/src/install-xpi
@@ -158,9 +158,16 @@ def install_xpi(script_name, package, xpi_file, exclude, install_dir, links,
prefname = package.replace("xul-ext-", "") + ".js"
# create system preference file
f = open(os.path.join(full_prefdir, prefname), "w")
- f.write("// Place your preferences for " + package + " in this file.\n")
- f.write("// You can override here the preferences specified in\n")
- map(lambda x: f.write("// " + os.path.join("/", install_dir, x) + "\n"), preferences)
+ if os.path.isfile(os.path.join("debian", package + ".js")):
+ # use debian/package.js as configuration file if it exists
+ content = open(os.path.join("debian", package + ".js")).read()
+ # replace @INSTALLDIR@ by the actual installation directory
+ content = content.replace("@INSTALLDIR@", os.path.join("/", install_dir))
+ f.write(content)
+ else:
+ f.write("// Place your preferences for " + package + " in this file.\n")
+ f.write("// You can override here the preferences specified in\n")
+ map(lambda x: f.write("// " + os.path.join("/", install_dir, x) + "\n"), preferences)
f.close()
link_source = os.path.join(prefdir, prefname)
link_target = os.path.join(install_dir, "defaults", "preferences", "000system.js")