Bug 468197 - Simplify / automate the addition of the pre-release suffix string (e.g. Alpha 1, Beta 2, etc.). r=mconnor
authorRobert Strong <robert.bugzilla@gmail.com>
Sun, 15 Feb 2009 15:04:05 -0800
changeset 25015 8a3394e165a9a6bcb027adafd4f87ae7020c34dd
parent 25014 50257d40e1466bb9a328ff8f266bd45b4c651b09
child 25016 068a8108e6238789d325d6798fc36b42a825d11f
push idunknown
push userunknown
push dateunknown
reviewersmconnor
bugs468197
milestone1.9.2a1pre
Bug 468197 - Simplify / automate the addition of the pre-release suffix string (e.g. Alpha 1, Beta 2, etc.). r=mconnor
browser/base/Makefile.in
browser/base/content/browser.xul
browser/branding/unofficial/branding.nsi
browser/installer/windows/Makefile.in
browser/installer/windows/nsis/branding.nsi
browser/installer/windows/nsis/defines.nsi.in
other-licenses/branding/firefox/branding.nsi
--- a/browser/base/Makefile.in
+++ b/browser/base/Makefile.in
@@ -15,16 +15,17 @@
 # The Original Code is mozilla.org code.
 #
 # The Initial Developer of the Original Code is
 # Netscape Communications Corporation.
 # Portions created by the Initial Developer are Copyright (C) 1998
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
+#  Robert Strong <robert.bugzilla@gmail.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -49,19 +50,24 @@ abs_srcdir = $(shell cd $(srcdir) && pwd
 CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
 
 ifdef ENABLE_TESTS
 DIRS += content/test
 endif
 
 include $(topsrcdir)/config/rules.mk
 
+PRE_RELEASE_SUFFIX = $(shell cat $(srcdir)/../config/version.txt | \
+  sed -e '/pre/s/.*//g' -e '/[ab][0-9]/!s/.*//g' \
+      -e 's/.*[0-9]a\([0-9]\+\)/ Alpha \1/g' -e 's/.*[0-9]b\([0-9]\+\)/ Beta \1/g')
+
 DEFINES += \
 	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 	-DAPP_LICENSE_BLOCK=$(abs_srcdir)/content/overrides/app-license.html \
+	-DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)" \
 	$(NULL)
 
 ifndef MOZ_BRANDING_DIRECTORY
 DEFINES += -DMOZ_USE_GENERIC_BRANDING
 endif
 
 ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DHAVE_SHELL_SERVICE=1
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -1,8 +1,9 @@
+#filter substitution
 <?xml version="1.0"?>
 # -*- Mode: HTML -*-
 #
 # ***** 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
@@ -26,16 +27,17 @@
 #   Blake Ross <blake@cs.stanford.edu>
 #   David Hyatt <hyatt@mozilla.org>
 #   Joe Hewitt <hewitt@netscape.com>
 #   Pierre Chanial <chanial@noos.fr>
 #   Dean Tessman <dean_tessman@hotmail.com>
 #   Johnathan Nightingale <johnath@mozilla.com>
 #   Dão Gottwald <dao@mozilla.com>
 #   Ehsan Akhgari <ehsan.akhgari@gmail.com>
+#   Robert Strong <robert.bugzilla@gmail.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -63,29 +65,29 @@
 
 <window id="main-window"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="BrowserStartup()" onunload="BrowserShutdown()" onclose="return WindowIsClosing();"
         ondragleave="gBrowser.browserWindowOnDragLeave(event);"
         ondragenter="gBrowser.browserWindowOnDragEnter(event);"
-        title="&mainWindow.title;"
-        title_normal="&mainWindow.title;"
+        title="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
+        title_normal="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
 #ifdef XP_MACOSX
-        title_privatebrowsing="&mainWindow.title;&mainWindow.titlemodifiermenuseparator;&mainWindow.titlePrivateBrowsingSuffix;"
-        titledefault="&mainWindow.title;"
+        title_privatebrowsing="&mainWindow.title;@PRE_RELEASE_SUFFIX@&mainWindow.titlemodifiermenuseparator;&mainWindow.titlePrivateBrowsingSuffix;"
+        titledefault="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
         titlemodifier=""
         titlemodifier_normal=""
         titlemodifier_privatebrowsing="&mainWindow.titlePrivateBrowsingSuffix;"
 #else
-        title_privatebrowsing="&mainWindow.titlemodifierPrivateBrowsing;"
-        titlemodifier="&mainWindow.titlemodifier;"
-        titlemodifier_normal="&mainWindow.titlemodifier;"
-        titlemodifier_privatebrowsing="&mainWindow.titlemodifierPrivateBrowsing;"
+        title_privatebrowsing="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@ &mainWindow.titlePrivateBrowsingSuffix;"
+        titlemodifier="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@"
+        titlemodifier_normal="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@"
+        titlemodifier_privatebrowsing="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@ &mainWindow.titlePrivateBrowsingSuffix;"
 #endif
         titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
         windowtype="navigator:browser"
         screenX="4" screenY="4"
         browsingmode="normal"
         persist="screenX screenY width height sizemode"> 
 
 # All JS files which are not content (only) dependent that browser.xul
--- a/browser/branding/unofficial/branding.nsi
+++ b/browser/branding/unofficial/branding.nsi
@@ -32,24 +32,16 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # NSIS branding defines for unofficial builds.
 # The official release build branding.nsi is located in other-license/branding/firefox/
 # The nightly build branding.nsi is located in browser/installer/windows/nsis/
-!define BrandShortName        "Shiretoko"
+
 # BrandFullNameInternal is used for some registry and file system values
 # instead of BrandFullName and typically should not be modified.
 !define BrandFullNameInternal "Shiretoko"
 !define CompanyName           "mozilla.org"
 !define URLInfoAbout          "http://www.mozilla.org"
 !define URLUpdateInfo         "http://www.mozilla.org/projects/firefox"
 !define SurveyURL             "https://survey.mozilla.com/1/Mozilla%20Firefox/${AppVersion}/${AB_CD}/exit.html"
-
-# Everything below this line may be modified for Alpha / Beta releases.
-!define BrandFullName         "Shiretoko"
-
-# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation
-# directory in the registry and using that as the default. This prevents
-# Beta releases built with official branding from finding an existing install
-# of an official release and defaulting to its installation directory.
--- a/browser/installer/windows/Makefile.in
+++ b/browser/installer/windows/Makefile.in
@@ -17,16 +17,17 @@
 # IBM Corporation.
 # Portions created by the Initial Developer are Copyright (C) 2004
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #  Brian Ryner <bryner@brianryner.com>
 #  Chase Phillips <cmp@mozilla.org>
 #  Ehsan Akhgari <ehsan.akhgari@gmail.com>
+#  Robert Strong <robert.bugzilla@gmail.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -43,16 +44,22 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 CONFIG_DIR = instgen
 SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx
+APP_VERSION = $(shell cat $(srcdir)/../../config/version.txt)
+DEFINES += -DAPP_VERSION=$(APP_VERSION)
+PRE_RELEASE_SUFFIX = $(shell echo $(APP_VERSION) | \
+  sed -e '/pre/s/.*//g' -e '/[ab][0-9]/!s/.*//g' \
+      -e 's/.*[0-9]a\([0-9]\+\)/ Alpha \1/g' -e 's/.*[0-9]b\([0-9]\+\)/ Beta \1/g')
+DEFINES += -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
 
 PP_LOCALIZED_FILES = \
 	packages-static \
 	$(NULL)
 
 # All script and locale files used by the Unicode version of NSIS need to be
 # converted from UTF-8 to UTF-16LE
 INSTALLER_FILES_CONV = \
@@ -74,19 +81,16 @@ BRANDING_FILES_CONV = \
 BRANDING_FILES = \
 	wizHeader.bmp \
 	wizHeaderRTL.bmp \
 	wizWatermark.bmp \
 	$(NULL)
 
 DEFINES += \
 	-DAB_CD=$(AB_CD) \
-	-DPKG_BASENAME="$(PKG_BASENAME)" \
-	-DPKG_INST_BASENAME="$(PKG_INST_BASENAME)" \
-	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
 	-DMOZ_APP_DISPLAYNAME=${MOZ_APP_DISPLAYNAME} \
 	-DMOZILLA_VERSION=${MOZILLA_VERSION} \
 	$(NULL)
 
 include $(topsrcdir)/config/config.mk
 
 installer::
--- a/browser/installer/windows/nsis/branding.nsi
+++ b/browser/installer/windows/nsis/branding.nsi
@@ -32,24 +32,16 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # NSIS branding defines for nightly builds.
 # The official release build branding.nsi is located in other-license/branding/firefox/
 # The unofficial build branding.nsi is located in browser/branding/unofficial/
-!define BrandShortName        "Minefield"
+
 # BrandFullNameInternal is used for some registry and file system values
 # instead of BrandFullName and typically should not be modified.
 !define BrandFullNameInternal "Minefield"
 !define CompanyName           "mozilla.org"
 !define URLInfoAbout          "http://www.mozilla.org"
 !define URLUpdateInfo         "http://www.mozilla.org/projects/firefox"
 !define SurveyURL             "https://survey.mozilla.com/1/Mozilla%20Firefox/${AppVersion}/${AB_CD}/exit.html"
-
-# Everything below this line may be modified for Alpha / Beta releases.
-!define BrandFullName         "Minefield"
-
-# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation
-# directory in the registry and using that as the default. This prevents
-# Beta releases built with official branding from finding an existing install
-# of an official release and defaulting to its installation directory.
--- a/browser/installer/windows/nsis/defines.nsi.in
+++ b/browser/installer/windows/nsis/defines.nsi.in
@@ -1,13 +1,23 @@
 #filter substitution
-!define AppVersion            "@MOZ_APP_VERSION@"
+!define AppVersion            "@APP_VERSION@"
 !define GREVersion            @MOZILLA_VERSION@
 !define AB_CD                 "@AB_CD@"
-!define FileInstallerEXE      "@PKG_INST_BASENAME@.exe"
-!define FileInstallerMSI      "@PKG_INST_BASENAME@.msi"
-!define FileInstallerNETRoot  "@PKG_BASENAME@.net-installer"
 
 !define FileMainEXE           "@MOZ_APP_NAME@.exe"
 !define WindowClass           "FirefoxMessageWindow"
 !define DDEApplication        "Firefox"
 !define AppRegName            "Firefox"
 !define MinSupportedVer       "Microsoft Windows 2000"
+
+!define BrandShortName        "@MOZ_APP_DISPLAYNAME@"
+!define PreReleaseSuffix      "@PRE_RELEASE_SUFFIX@"
+!define BrandFullName         "${BrandFullNameInternal}${PreReleaseSuffix}"
+
+# NO_INSTDIR_FROM_REG is defined for pre-releases which have a PreReleaseSuffix
+# (e.g. Alpha X, Beta X, etc.) to prevent finding a non-default installation
+# directory in the registry and using that as the default. This prevents
+# Beta releases built with official branding from finding an existing install
+# of an official release and defaulting to its installation directory.
+!if "@PRE_RELEASE_SUFFIX@" != ""
+!define NO_INSTDIR_FROM_REG
+!endif
--- a/other-licenses/branding/firefox/branding.nsi
+++ b/other-licenses/branding/firefox/branding.nsi
@@ -32,24 +32,16 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # NSIS branding defines for official release builds.
 # The nightly build branding.nsi is located in browser/installer/windows/nsis/
 # The unofficial build branding.nsi is located in browser/branding/unofficial/
-!define BrandShortName        "Firefox"
+
 # BrandFullNameInternal is used for some registry and file system values
 # instead of BrandFullName and typically should not be modified.
 !define BrandFullNameInternal "Mozilla Firefox"
 !define CompanyName           "Mozilla Corporation"
 !define URLInfoAbout          "http://${AB_CD}.www.mozilla.com/${AB_CD}/"
 !define URLUpdateInfo         "http://${AB_CD}.www.mozilla.com/${AB_CD}/firefox/"
 !define SurveyURL             "https://survey.mozilla.com/1/Mozilla%20Firefox/${AppVersion}/${AB_CD}/exit.html"
-
-# Everything below this line may be modified for Alpha / Beta releases.
-!define BrandFullName         "Mozilla Firefox"
-
-# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation
-# directory in the registry and using that as the default. This prevents
-# Beta releases built with official branding from finding an existing install
-# of an official release and defaulting to its installation directory.