Bug 759460 - Preprocess channel name into nsUpdateService.js instead of just using 'default'. r=bbondy, a=akeybl
authorRobert Strong <robert.bugzilla@gmail.com>
Sun, 03 Jun 2012 22:21:31 -0700
changeset 95949 49bd90effd98d2e8d51f6c43c782206e57aad47d
parent 95948 762d16222aba62fd45c00ca98262ae5856e39133
child 95950 6b1e65dae1d59fe32c09eb84b93032d446bb12e0
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy, akeybl
bugs759460
milestone14.0a2
Bug 759460 - Preprocess channel name into nsUpdateService.js instead of just using 'default'. r=bbondy, a=akeybl
toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -1,8 +1,10 @@
+#filter substitution
+
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
 # ***** BEGIN LICENSE BLOCK *****
 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
 #
 # The contents of this file are subject to the Mozilla Public License Version
 # 1.1 (the "License"); you may not use this file except in compliance with
 # the License. You may obtain a copy of the License at
@@ -739,25 +741,27 @@ function getLocale() {
 }
 
 /**
  * Read the update channel from defaults only.  We do this to ensure that
  * the channel is tightly coupled with the application and does not apply
  * to other instances of the application that may use the same profile.
  */
 function getUpdateChannel() {
-  var channel = "default";
+  // Preprocess the channel name that is defined when building to allow updating
+  // even when the preference file that defines the channel name doesn't exist.
+  var channel = "@MOZ_UPDATE_CHANNEL@";
   var prefName;
   var prefValue;
 
   try {
     channel = Services.prefs.getDefaultBranch(null).
               getCharPref(PREF_APP_UPDATE_CHANNEL);
   } catch (e) {
-    // use default when pref not found
+    // Use the channel name that was preprocessed when building above.
   }
 
   try {
     var partners = Services.prefs.getChildList(PREF_PARTNER_BRANCH);
     if (partners.length) {
       channel += "-cck";
       partners.sort();