1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-19 19:47:59 +01:00

Fix initialization from XPI.

This commit is contained in:
Kris Maglione
2014-02-19 17:58:34 -08:00
parent 160e66430c
commit 382ada9abf
4 changed files with 34 additions and 2 deletions

View File

@@ -177,6 +177,10 @@ xpi: $(CHROME)
-f $(BASE)/process_manifest.awk \
"$(TOP)/chrome.manifest" >"$(XPI_PATH)/chrome.manifest"
$(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \
-f $(BASE)/process_config.awk \
"$(TOP)/config.json" >"$(XPI_PATH)/config.json"
version="$(VERSION)"; \
hg root >/dev/null 2>&1 && \
case "$$version" in \

4
common/bootstrap.js vendored
View File

@@ -309,7 +309,9 @@ function updateVersion() {
// Disable automatic updates when switching to nightlies,
// restore the default action when switching to stable.
if (!config.lastVersion || isDev(config.lastVersion) != isDev(addon.version))
addon.applyBackgroundUpdates = AddonManager[isDev(addon.version) ? "AUTOUPDATE_DISABLE" : "AUTOUPDATE_DEFAULT"];
addon.applyBackgroundUpdates =
AddonManager[isDev(addon.version) ? "AUTOUPDATE_DISABLE"
: "AUTOUPDATE_DEFAULT"];
}
catch (e) {
reportError(e);

22
common/process_config.awk Normal file
View File

@@ -0,0 +1,22 @@
BEGIN {
chrome = "chrome"
if (suffix)
chrome = suffix
}
/^ \}/ { on = 0 }
on && $NF ~ /^"([a-z]|\.\/)/ {
$NF = "\"/" name "/" substr($NF, 2)
}
/./ && on {
sub(/^"\.\./, "\"", $NF);
$NF = "\"" chrome substr($NF, 2)
}
/./ && on {
gsub(/\/\.\//, "/")
sub(/^\"\.\.\/common\//, "\"", $NF)
$0 = " " $0
}
//
/^ "resources": \{/ { on = 1 }

View File

@@ -3,8 +3,12 @@ BEGIN {
if (suffix)
chrome = suffix
}
{ content = $1 ~ /^(content|skin|locale|resource)$/ }
content && $NF ~ /^[a-z]|^\.\// { $NF = "/" name "/" $NF }
content && $NF ~ /^([a-z]|\.\/)/ {
$NF = "/" name "/" $NF
}
content {
sub(/^\.\./, "", $NF);
if (isjar)