Bug 1502457 - Derive the default update channel from the application display version. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 16 Nov 2018 01:16:59 +0000
changeset 446946 88ba9f723934
parent 446945 83e6f0d47a80
child 446949 e44bb5b4bc79
push id35061
push userebalazs@mozilla.com
push dateMon, 19 Nov 2018 09:27:38 +0000
treeherdermozilla-central@88ba9f723934 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1502457
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1502457 - Derive the default update channel from the application display version. r=nalexander Depends on D11986 Differential Revision: https://phabricator.services.mozilla.com/D11987
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -1149,23 +1149,39 @@ set_config('MOZILLA_SYMBOLVERSION', mile
 # JS configure still wants to look at these.
 add_old_configure_assignment('MOZILLA_VERSION', milestone.version)
 add_old_configure_assignment('MOZILLA_SYMBOLVERSION', milestone.symbolversion)
 
 set_config('MOZ_APP_VERSION', milestone.app_version)
 set_config('MOZ_APP_VERSION_DISPLAY', milestone.app_version_display)
 add_old_configure_assignment('MOZ_APP_VERSION', milestone.app_version)
 
-# The app update channel is 'default' when not supplied. The value is used in
-# the application's confvars.sh (and is made available to a project specific
-# moz.configure).
+
+# The app update channel is 'default' when not supplied, and MOZILLA_OFFICIAL
+# is not set. When MOZILLA_OFFICIAL is set, the default is derived from
+# the application display version.
+@depends(milestone, mozilla_official)
+def default_update_channel(milestone, mozilla_official):
+    if not mozilla_official:
+        return 'default'
+    if milestone.is_release_or_beta:
+        if 'esr' in milestone.app_version_display:
+            return 'esr'
+        if 'b' in milestone.app_version_display:
+            return 'beta'
+        return 'release'
+    if milestone.is_nightly:
+        return 'nightly'
+    return 'default'
+
+
 option('--enable-update-channel',
        nargs=1,
        help='Select application update channel',
-       default='default')
+       default=default_update_channel)
 
 
 @depends('--enable-update-channel')
 def update_channel(channel):
     if channel[0] == '':
         return 'default'
     return channel[0].lower()