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:
@@ -177,6 +177,10 @@ xpi: $(CHROME)
|
|||||||
-f $(BASE)/process_manifest.awk \
|
-f $(BASE)/process_manifest.awk \
|
||||||
"$(TOP)/chrome.manifest" >"$(XPI_PATH)/chrome.manifest"
|
"$(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)"; \
|
version="$(VERSION)"; \
|
||||||
hg root >/dev/null 2>&1 && \
|
hg root >/dev/null 2>&1 && \
|
||||||
case "$$version" in \
|
case "$$version" in \
|
||||||
|
|||||||
4
common/bootstrap.js
vendored
4
common/bootstrap.js
vendored
@@ -309,7 +309,9 @@ function updateVersion() {
|
|||||||
// Disable automatic updates when switching to nightlies,
|
// Disable automatic updates when switching to nightlies,
|
||||||
// restore the default action when switching to stable.
|
// restore the default action when switching to stable.
|
||||||
if (!config.lastVersion || isDev(config.lastVersion) != isDev(addon.version))
|
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) {
|
catch (e) {
|
||||||
reportError(e);
|
reportError(e);
|
||||||
|
|||||||
22
common/process_config.awk
Normal file
22
common/process_config.awk
Normal 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 }
|
||||||
@@ -3,8 +3,12 @@ BEGIN {
|
|||||||
if (suffix)
|
if (suffix)
|
||||||
chrome = suffix
|
chrome = suffix
|
||||||
}
|
}
|
||||||
|
|
||||||
{ content = $1 ~ /^(content|skin|locale|resource)$/ }
|
{ content = $1 ~ /^(content|skin|locale|resource)$/ }
|
||||||
content && $NF ~ /^[a-z]|^\.\// { $NF = "/" name "/" $NF }
|
|
||||||
|
content && $NF ~ /^([a-z]|\.\/)/ {
|
||||||
|
$NF = "/" name "/" $NF
|
||||||
|
}
|
||||||
content {
|
content {
|
||||||
sub(/^\.\./, "", $NF);
|
sub(/^\.\./, "", $NF);
|
||||||
if (isjar)
|
if (isjar)
|
||||||
|
|||||||
Reference in New Issue
Block a user