Fix bug 940402 - Calculate Lightning version from Thunderbird version. r=jcranmer,a=Callek for CLOSED TREE
authorPhilipp Kewisch <mozilla@kewis.ch>
Mon, 16 Dec 2013 20:22:07 +0100
changeset 17085 8d82423a804fb0b5cfd97d18645ab0ffd6304723
parent 17084 04892ed33bd6862bb3e7b72998af40330cacf416
child 17086 1f890b59ac387094c867dd8653e7172567699218
push id1103
push usermbanner@mozilla.com
push dateTue, 18 Mar 2014 07:44:06 +0000
treeherdercomm-beta@50c6279a0af0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcranmer, Callek
bugs940402
Fix bug 940402 - Calculate Lightning version from Thunderbird version. r=jcranmer,a=Callek for CLOSED TREE
calendar/lightning/Makefile.in
calendar/lightning/build/makeversion.py
calendar/lightning/build/universal.mk
calendar/providers/gdata/Makefile.in
calendar/sunbird/config/version.txt
calendar/timezones/Makefile.in
mail/configure.in
suite/configure.in
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -17,19 +17,19 @@ XPI_PKGNAME = lightning-$(LIGHTNING_VERS
 XPI_VERSION = $(LIGHTNING_VERSION)
 
 XPI_EM_ID = {e2fda1a4-762b-4020-b5ad-a41df1933103}
 
 DIST_FILES = install.rdf application.ini
 PREF_JS_EXPORTS = $(srcdir)/content/lightning.js
 
 # Lighting version number
-LIGHTNING_VERSION := $(shell cat $(srcdir)/../sunbird/config/version.txt)
 THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
 SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
+LIGHTNING_VERSION := $(shell $(PYTHON) $(srcdir)/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 GDATA_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/providers/gdata/makeversion.py $(LIGHTNING_VERSION))
 
 # For extensions we require a max version that is compatible across security releases.
 # THUNDERBIRD_MAXVERSION and SEAMONKEY_MAXVERSION is our method for doing that.
 # Alpha versions 10.0a1 and 10.0a2 aren't affected
 # For Seamonkey, 2.17 becomes 2.17.*, 2.17.1 becomes 2.17.*
 # For Thunderbird, 10.0 becomes 10.*, 10.0.1 becomes 10.*
 THUNDERBIRD_MAXVERSION := $(THUNDERBIRD_VERSION)
new file mode 100644
--- /dev/null
+++ b/calendar/lightning/build/makeversion.py
@@ -0,0 +1,20 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import sys
+import re
+
+# Change this number to add an amount to the minor, i.e with MINOR_ADD=2,
+# 24.2.0 becomes 2.6.4 instead of 2.6.2
+MINOR_ADD=0
+
+def makeversion(x):
+  parts = x.split('.')
+  major = str((int(parts[0]) + 2))
+  parts[0] = major[:-1] + "." + major[-1]
+  if len(parts) > 1 and parts[1].isdigit():
+    parts[1] = str(int(parts[1]) + MINOR_ADD)
+  return re.sub(r'.0([ab][0-9]*|)$', r'\1', '.'.join(parts))
+
+print(makeversion(sys.argv[1]))
--- a/calendar/lightning/build/universal.mk
+++ b/calendar/lightning/build/universal.mk
@@ -12,17 +12,18 @@ OBJDIR = $(OBJDIR_ARCH_1)
 endif
 
 topsrcdir = $(TOPSRCDIR)
 DEPTH = $(OBJDIR)
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/mozilla/toolkit/mozapps/installer/package-name.mk
 
-LIGHTNING_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version.txt)
+THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
+LIGHTNING_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 XPI_PKGNAME = lightning-$(LIGHTNING_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 
 STANDALONE_MAKEFILE := 1
 include $(TOPSRCDIR)/config/config.mk
 
 postflight_all:
 	mkdir -p $(DIST_UNI)/xpi-stage
 	rm -rf $(DIST_UNI)/xpi-stage/lightning*
--- a/calendar/providers/gdata/Makefile.in
+++ b/calendar/providers/gdata/Makefile.in
@@ -10,19 +10,19 @@ VPATH = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 export USE_EXTENSION_MANIFEST = 1
 DIST_FILES = install.rdf
 XPI_PKGNAME = gdata-provider-$(GDATA_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 XPI_VERSION = $(GDATA_VERSION)
 XPI_NO_UNIVERSAL = 1
 
-CALENDAR_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version.txt)
 THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
 SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
+CALENDAR_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 GDATA_VERSION = $(shell $(PYTHON) $(srcdir)/makeversion.py $(CALENDAR_VERSION))
 
 DEFINES += -DAB_CD=$(AB_CD) \
            -DCALENDAR_VERSION=$(CALENDAR_VERSION) \
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
            -DCOMM_BUILD=$(COMM_BUILD) \
            -DGDATA_VERSION=$(GDATA_VERSION) \
deleted file mode 100644
--- a/calendar/sunbird/config/version.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-3.1a1
--- a/calendar/timezones/Makefile.in
+++ b/calendar/timezones/Makefile.in
@@ -34,19 +34,19 @@ XPI_PKGNAME = calendar-timezones
 
 PREF_JS_EXPORTS = $(srcdir)/defaults/preferences.js
 
 ifndef DISABLE_LIGHTNING_INSTALL
 # install as a global extension in dist/bin/extensions/
 INSTALL_EXTENSION_ID = calendar-timezones@mozilla.org
 endif
 
-CALENDAR_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version.txt)
 THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
 SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
+CALENDAR_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 TIMEZONES_VERSION := $(shell cat $(srcdir)/config/version.txt)
 
 DEFINES += -DAB_CD=$(AB_CD) \
            -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DCALENDAR_VERSION=$(CALENDAR_VERSION) \
            -DTIMEZONES_VERSION=$(TIMEZONES_VERSION) \
            $(NULL)
--- a/mail/configure.in
+++ b/mail/configure.in
@@ -25,19 +25,17 @@ fi
 AC_SUBST(MOZ_MOVEMAIL)
 
 dnl Get other versions (for the calendar plugin)
 if test "$COMM_BUILD" = "1"; then
   commdir=$topsrcdir
 else
   commdir=$topsrcdir/..
 fi
-SUNBIRD_VERSION=`cat $commdir/calendar/sunbird/config/version.txt`
 SEAMONKEY_VERSION=`cat $commdir/suite/config/version.txt`
-AC_SUBST(SUNBIRD_VERSION)
 AC_SUBST(SEAMONKEY_VERSION)
 
 dnl =========================================================
 dnl = Lightning extension
 dnl =========================================================
 MOZ_ARG_ENABLE_BOOL(calendar,
 [  --enable-calendar      Enable building of the Lightning calendar extension],
     MOZ_CALENDAR=1,
--- a/suite/configure.in
+++ b/suite/configure.in
@@ -25,19 +25,17 @@ fi
 AC_SUBST(MOZ_MOVEMAIL)
 
 dnl Get other versions (for the calendar plugin)
 if test "$COMM_BUILD" = "1"; then
   commdir=$topsrcdir
 else
   commdir=$topsrcdir/..
 fi
-SUNBIRD_VERSION=`cat $commdir/calendar/sunbird/config/version.txt`
 THUNDERBIRD_VERSION=`cat $commdir/mail/config/version.txt`
-AC_SUBST(SUNBIRD_VERSION)
 AC_SUBST(THUNDERBIRD_VERSION)
 
 dnl =========================================================
 dnl = Lightning extension
 dnl =========================================================
 MOZ_ARG_ENABLE_BOOL(calendar,
 [  --enable-calendar      Enable building of the Lightning calendar extension],
     MOZ_CALENDAR=1,