From e154039bd85e7ed44ca66593bc41f7e5dc754823 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Sun, 11 Apr 2010 20:44:30 +0200 Subject: * Use debian/package.js as configuration file if it exists. - update man/install-xpi.1 - update src/install-xpi --- src/install-xpi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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") -- cgit v1.2.3