commit 8d3644dc7e04b112f6dbab95519ac3b01cc6d45e Author: Sukhbir Singh sukhbir@torproject.org Date: Fri Jul 15 18:13:22 2016 -0400
Apply aboutDialog*-specific patches from #4234
The aboutDialog* patches are applied separately since we copy these files to the Instantbird build process.
Patches copied from commit 3f8110f69e1ddf, tor-browser-45.1.1esr-6.0-1 branch. --- projects/instantbird/aboutDialog-appUpdater.js | 29 +++++++++++++++++++++----- projects/instantbird/aboutDialog-jar.patch | 4 ++-- projects/instantbird/aboutDialog.js | 17 ++++++++++++--- 3 files changed, 40 insertions(+), 10 deletions(-)
diff --git a/projects/instantbird/aboutDialog-appUpdater.js b/projects/instantbird/aboutDialog-appUpdater.js index 66db02a..f223f06 100644 --- a/projects/instantbird/aboutDialog-appUpdater.js +++ b/projects/instantbird/aboutDialog-appUpdater.js @@ -196,9 +196,13 @@ appUpdater.prototype = doUpdate: function() { // skip the compatibility check if the update doesn't provide appVersion, // or the appVersion is unchanged, e.g. nightly update +#ifdef TOR_BROWSER_UPDATE + let pkgVersion = TOR_BROWSER_VERSION; +#else + let pkgVersion = Services.appinfo.version; +#endif if (!this.update.appVersion || - Services.vc.compare(gAppUpdater.update.appVersion, - Services.appinfo.version) == 0) { + Services.vc.compare(gAppUpdater.update.appVersion, pkgVersion) == 0) { this.startDownload(); } else { this.checkAddonCompatibility(); @@ -353,11 +357,16 @@ appUpdater.prototype = // (see bug 566787). The hotfix add-on is also ignored as it shouldn't // block the user from upgrading. try { +#ifdef TOR_BROWSER_UPDATE + let compatVersion = self.update.platformVersion; +#else + let compatVersion = self.update.appVersion; +#endif if (aAddon.type != "plugin" && aAddon.id != hotfixID && !aAddon.appDisabled && !aAddon.userDisabled && aAddon.scope != AddonManager.SCOPE_APPLICATION && aAddon.isCompatible && - !aAddon.isCompatibleWith(self.update.appVersion, + !aAddon.isCompatibleWith(compatVersion, self.update.platformVersion)) self.addons.push(aAddon); } @@ -381,8 +390,13 @@ appUpdater.prototype = */ checkAddonsForUpdates: function() { this.addons.forEach(function(aAddon) { +#ifdef TOR_BROWSER_UPDATE + let compatVersion = this.update.platformVersion; +#else + let compatVersion = this.update.appVersion; +#endif aAddon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED, - this.update.appVersion, + compatVersion, this.update.platformVersion); }, this); }, @@ -403,8 +417,13 @@ appUpdater.prototype = * See XPIProvider.jsm */ onUpdateAvailable: function(aAddon, aInstall) { +#ifdef TOR_BROWSER_UPDATE + let compatVersion = this.update.platformVersion; +#else + let compatVersion = this.update.appVersion; +#endif if (!Services.blocklist.isAddonBlocklisted(aAddon, - this.update.appVersion, + compatVersion, this.update.platformVersion)) { // Compatibility or new version updates mean the same thing here. this.onCompatibilityUpdateAvailable(aAddon); diff --git a/projects/instantbird/aboutDialog-jar.patch b/projects/instantbird/aboutDialog-jar.patch index 2a1ed6d..0257e61 100644 --- a/projects/instantbird/aboutDialog-jar.patch +++ b/projects/instantbird/aboutDialog-jar.patch @@ -8,8 +8,8 @@ diff --git a/im/content/jar.mn b/im/content/jar.mn -* content/instantbird/aboutDialog.xul - content/instantbird/aboutPanel.xml + content/instantbird/aboutDialog.xul -+ content/instantbird/aboutDialog.js -+ content/instantbird/aboutDialog-appUpdater.js ++* content/instantbird/aboutDialog.js ++* content/instantbird/aboutDialog-appUpdater.js content/instantbird/account.js content/instantbird/accounts.css content/instantbird/accounts.js diff --git a/projects/instantbird/aboutDialog.js b/projects/instantbird/aboutDialog.js index 55043af..25b2793 100644 --- a/projects/instantbird/aboutDialog.js +++ b/projects/instantbird/aboutDialog.js @@ -8,6 +8,11 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm");
const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
+#ifdef TOR_BROWSER_VERSION +# Add double-quotes back on (stripped by JarMaker.py). +#expand const TOR_BROWSER_VERSION = "__TOR_BROWSER_VERSION__"; +#endif + function init(aEvent) { if (aEvent.target != document) @@ -43,13 +48,19 @@ function init(aEvent) // Include the build ID and display warning if this is an "a#" (nightly or aurora) build let version = Services.appinfo.version; if (/a\d+$/.test(version)) { - let buildID = Services.appinfo.appBuildID; - let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8); - document.getElementById("version").textContent += " (" + buildDate + ")"; document.getElementById("experimental").hidden = false; document.getElementById("communityDesc").hidden = true; }
+#ifdef TOR_BROWSER_VERSION + let versionElem = document.getElementById("version"); + if (versionElem) { + versionElem.textContent = TOR_BROWSER_VERSION + + " (based on Mozilla Firefox " + + versionElem.textContent + ")"; + } +#endif + if (AppConstants.MOZ_UPDATER) { gAppUpdater = new appUpdater();
tor-commits@lists.torproject.org