From c54aa3f56b951fb04c82fbe70c520e50a498d51a Mon Sep 17 00:00:00 2001
From: "bsmedberg%covad.net" <bsmedberg%covad.net>
Date: Tue, 16 Aug 2005 19:28:01 +0000
Subject: [PATCH] Bug 304476 (and 304478) - remove app.extensions.version from
 default prefs - r=chase

---
 .../Makefile.in                               |  2 ++
 .../install.rdf.in                            |  6 +++--
 browser/app/profile/firefox.js                |  5 ----
 client.mk                                     |  4 ++-
 config/autoconf.mk.in                         |  4 +++
 configure.in                                  | 26 +++++++++----------
 extensions/inspector/Makefile.in              |  6 ++---
 extensions/layout-debug/application.ini       |  4 +--
 extensions/reporter/Makefile.in               |  6 ++---
 extensions/reporter/install.rdf               |  2 +-
 extensions/spatialnavigation/Makefile.in      |  5 ++--
 extensions/spatialnavigation/install.rdf      |  2 +-
 extensions/spatialnavigation/src/Makefile.in  | 10 -------
 mail/app/profile/all-thunderbird.js           |  1 -
 .../Makefile.in                               |  2 ++
 .../install.rdf.in                            |  6 +++--
 xulrunner/examples/simple/application.ini     | 10 +++----
 17 files changed, 49 insertions(+), 52 deletions(-)

diff --git a/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in b/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
index 9c9eccc40e179..9fc0e576dd8bc 100644
--- a/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
+++ b/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
@@ -43,6 +43,8 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
+DEFINES += -DFIREFOX_VERSION=$(FIREFOX_VERSION)
+
 FILES := \
 	install.rdf \
 	$(NULL)
diff --git a/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in b/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
index 67d80789214b1..64aa38e855071 100644
--- a/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
+++ b/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
@@ -1,5 +1,7 @@
 <?xml version="1.0"?>
 
+#filter substitution
+
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
 
@@ -12,8 +14,8 @@
     <em:targetApplication>
       <Description>
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>1.0+</em:minVersion>
-        <em:maxVersion>1.0+</em:maxVersion>
+        <em:minVersion>@FIREFOX_VERSION@</em:minVersion>
+        <em:maxVersion>@FIREFOX_VERSION@</em:maxVersion>
       </Description>
     </em:targetApplication>
     
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 46f96b67d0f39..14991c3d8e3cb 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -59,11 +59,6 @@ pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/ex
 pref("xpinstall.dialog.progress.type.skin", "Extension:Manager-themes");
 pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager-extensions");
 
-// This is the version number used by the Extension Manager to check extension
-// compatibility.  An extensions minVersion and maxVersion fields will be
-// compared to this value.  A trailing "+" indicates the post-release trunk.
-pref("app.extensions.version", "1.0+");
-
 pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties");
 pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties");
 // Developers can set this to |true| if they are constantly changing files in their 
diff --git a/client.mk b/client.mk
index f1887cd6666cf..9228a4d00bac1 100644
--- a/client.mk
+++ b/client.mk
@@ -103,8 +103,10 @@ AVAILABLE_PROJECTS = \
   macbrowser \
   $(NULL)
 
-MODULES_core :=                                \
+MODULES_core :=                                 \
   SeaMonkeyAll                                  \
+  browser/config/version.txt                    \
+  mail/config/version.txt                       \
   mozilla/ipc/ipcd                              \
   mozilla/modules/libpr0n                       \
   mozilla/modules/libmar                        \
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
index a005d663d01cf..c3bb82c66f368 100644
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -42,6 +42,10 @@ USE_AUTOCONF 	= 1
 MOZILLA_CLIENT	= 1
 BUILD_MODULES	= @BUILD_MODULES@
 MOZILLA_VERSION = @MOZILLA_VERSION@
+FIREFOX_VERSION	= @FIREFOX_VERSION@
+THUNDERBIRD_VERSION	= @THUNDERBIRD_VERSION@
+SEAMONKEY_VERSION	= @SEAMONKEY_VERSION@
+
 MOZ_BUILD_APP = @MOZ_BUILD_APP@
 MOZ_APP_NAME	= @MOZ_APP_NAME@
 MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
diff --git a/configure.in b/configure.in
index 6d04af937cce2..b1a498b63b498 100644
--- a/configure.in
+++ b/configure.in
@@ -1218,15 +1218,14 @@ esac
 
 dnl Get mozilla version from central milestone file
 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
-AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
 
-dnl Get the major and minor versions from the MOZILLA_VERSION
-changequote(,)
-MOZILLA_VERSION_MAJOR=`echo $MOZILLA_VERSION | sed 's|^\([0-9]*\).*|\1|'`
-MOZILLA_VERSION_MINOR=`echo $MOZILLA_VERSION | sed 's|^[0-9]*\.\([0-9]*\).*|\1|'`
-changequote([,])
-AC_DEFINE_UNQUOTED(MOZILLA_VERSION_MAJOR,$MOZILLA_VERSION_MAJOR)
-AC_DEFINE_UNQUOTED(MOZILLA_VERSION_MINOR,$MOZILLA_VERSION_MINOR)
+dnl Get version of various core apps from the version files.
+FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
+THUNDERBIRD_VERSION=`cat $topsrcdir/mail/config/version.txt`
+SEAMONKEY_VERSION=`cat $topsrcdir/xpfe/bootstrap/version.txt`
+
+AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
+AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
 
 dnl ========================================================
 dnl System overrides of the defaults for target
@@ -3995,7 +3994,7 @@ suite)
   MOZ_COMPOSER=1
   MOZ_SUITE=1
   MOZ_PROFILESHARING=
-  MOZ_APP_VERSION=`cat $topsrcdir/xpfe/bootstrap/version.txt`
+  MOZ_APP_VERSION=$SEAMONKEY_VERSION
   MOZ_EXTENSIONS_DEFAULT=" cookie wallet content-packs xml-rpc xmlextras help p3p pref transformiix venkman inspector irc universalchardet typeaheadfind webservices spellcheck gnomevfs negotiateauth sroaming permissions reporter"
   AC_DEFINE(MOZ_SUITE)
   ;;
@@ -4005,7 +4004,7 @@ browser)
   MOZ_APP_DISPLAYNAME=Firefox
   MOZ_XUL_APP=1
   MOZ_PHOENIX=1
-  MOZ_APP_VERSION=`cat $topsrcdir/browser/config/version.txt`
+  MOZ_APP_VERSION=$FIREFOX_VERSION
   MOZ_EXTENSIONS_DEFAULT=" cookie xml-rpc xmlextras pref transformiix universalchardet webservices inspector gnomevfs negotiateauth permissions reporter"
   AC_DEFINE(MOZ_PHOENIX)
   ;;
@@ -4056,7 +4055,7 @@ mail)
   MOZ_LDAP_XPCOM=1
   MOZ_STATIC_MAIL_BUILD=1
   MOZ_COMPOSER=1
-  MOZ_APP_VERSION=`cat $topsrcdir/mail/config/version.txt`
+  MOZ_APP_VERSION=$THUNDERBIRD_VERSION
   MOZ_EXTENSIONS_DEFAULT=" wallet spellcheck xmlextras pref webservices universalchardet"
   AC_DEFINE(MOZ_THUNDERBIRD)
   ;;
@@ -6742,6 +6741,9 @@ AC_SUBST(TARGET_DEVICE)
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
+AC_SUBST(FIREFOX_VERSION)
+AC_SUBST(THUNDERBIRD_VERSION)
+AC_SUBST(SEAMONKEY_VERSION)
 
 dnl win32 options
 AC_SUBST(MOZ_PROFILE)
@@ -6963,8 +6965,6 @@ AC_SUBST(CYGDRIVE_MOUNT)
 AC_SUBST(WIN_TOP_SRC)
 
 AC_SUBST(MOZILLA_VERSION)
-AC_SUBST(MOZILLA_VERSION_MAJOR)
-AC_SUBST(MOZILLA_VERSION_MINOR)
 
 . ${srcdir}/config/chrome-versions.sh
 AC_SUBST(MOZILLA_LOCALE_VERSION)
diff --git a/extensions/inspector/Makefile.in b/extensions/inspector/Makefile.in
index 6f2adc8f9504b..24dc5c516260a 100644
--- a/extensions/inspector/Makefile.in
+++ b/extensions/inspector/Makefile.in
@@ -65,9 +65,9 @@ DIST_FILES = install.rdf
 # that we've even pulled those files. So we hardcode them.
 
 XULAPP_DEFINES = \
-	-DFIREFOX_VERSION=1.0+ \
-	-DTHUNDERBIRD_VERSION=1.0+ \
-	-DEXTENSION_VERSION=1.7+ \
+	-DFIREFOX_VERSION=$(FIREFOX_VERSION) \
+	-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
+	-DEXTENSION_VERSION=$(MOZILLA_VERSION) \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
diff --git a/extensions/layout-debug/application.ini b/extensions/layout-debug/application.ini
index b1472ba0a9531..27d37b272acdc 100644
--- a/extensions/layout-debug/application.ini
+++ b/extensions/layout-debug/application.ini
@@ -8,5 +8,5 @@ Copyright=Copyright (c) 2004 Mozilla.org
 ID={da915c15-c21a-41e2-95c3-2e0f76fd3191}
 
 [Gecko]
-MinVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@
-MaxVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@
+MinVersion=@MOZILLA_VERSION_U@
+MaxVersion=@MOZILLA_VERSION_U@
diff --git a/extensions/reporter/Makefile.in b/extensions/reporter/Makefile.in
index 3fabb5a540e3a..8966c88bc3e46 100644
--- a/extensions/reporter/Makefile.in
+++ b/extensions/reporter/Makefile.in
@@ -99,9 +99,9 @@ DIST_FILES = install.rdf
 # # that we've even pulled those files. So we hardcode them.
 
 XULAPP_DEFINES = \
-	-DFIREFOX_VERSION=1.0+ \
-	-DTHUNDERBIRD_VERSION=1.0+ \
-	-DMOZILLA_VERSION_U=$(MOZILLA_VERSION) \
+	-DFIREFOX_VERSION=$(FIREFOX_VERSION) \
+	-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
+	-DEXTENSION_VERSION=$(MOZILLA_VERSION) \
 	$(NULL)
 
 PREF_JS_EXPORTS = $(srcdir)/resources/content/prefs/reporter.js
diff --git a/extensions/reporter/install.rdf b/extensions/reporter/install.rdf
index 78938a94983d6..e4812012ee573 100644
--- a/extensions/reporter/install.rdf
+++ b/extensions/reporter/install.rdf
@@ -6,7 +6,7 @@
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>reporter@mozilla.org</em:id>
-    <em:version>1.7+</em:version>
+    <em:version>@EXTENSION_VERSION@</em:version>
 
     <em:targetApplication>
       <!-- Firefox -->
diff --git a/extensions/spatialnavigation/Makefile.in b/extensions/spatialnavigation/Makefile.in
index 9a8a136a97ac8..68275c2a534a5 100755
--- a/extensions/spatialnavigation/Makefile.in
+++ b/extensions/spatialnavigation/Makefile.in
@@ -56,8 +56,9 @@ XPI_PKGNAME            = snav-$(MOZ_APP_VERSION)
 # that we've even pulled those files. So we hardcode them.
 
 XULAPP_DEFINES = \
-	-DFIREFOX_VERSION=1.0+ \
-	-DTHUNDERBIRD_VERSION=1.0+ \
+	-DFIREFOX_VERSION=$(FIREFOX_VERSION) \
+	-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
+	-DEXTENSION_VERSION=$(MOZILLA_VERSION) \
 	$(NULL)
 
 ifdef TARGET_XPCOM_ABI
diff --git a/extensions/spatialnavigation/install.rdf b/extensions/spatialnavigation/install.rdf
index c9108e04850a6..c57f83b3f3bda 100755
--- a/extensions/spatialnavigation/install.rdf
+++ b/extensions/spatialnavigation/install.rdf
@@ -6,7 +6,7 @@
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>spatial-navigation@extensions.mozilla.org</em:id>
-    <em:version>1.7+</em:version>
+    <em:version>@EXTENSION_VERSION@</em:version>
 
 #ifdef EM_ABI
     <em:targetPlatform>@EM_ABI@</em:targetPlatform>
diff --git a/extensions/spatialnavigation/src/Makefile.in b/extensions/spatialnavigation/src/Makefile.in
index 5df7d1aa1e90f..2248d7278178a 100755
--- a/extensions/spatialnavigation/src/Makefile.in
+++ b/extensions/spatialnavigation/src/Makefile.in
@@ -58,16 +58,6 @@ XPI_NAME               = snav
 endif
 endif
 
-# We should really pull FIREFOX_VERSION and THUNDERBIRD_VERSION from
-# # browser/config/version.txt mail/config/version.txt but we can't be assured
-# # that we've even pulled those files. So we hardcode them.
-
-XULAPP_DEFINES = \
-	-DFIREFOX_VERSION=1.0+ \
-	-DTHUNDERBIRD_VERSION=1.0+ \
-	-DMOZILLA_VERSION_U=$(MOZILLA_VERSION) \
-	$(NULL)
-
 REQUIRES	= xpcom \
 		      string \
 			  pref \
diff --git a/mail/app/profile/all-thunderbird.js b/mail/app/profile/all-thunderbird.js
index 0133123b7971f..a48fb020a0b1d 100644
--- a/mail/app/profile/all-thunderbird.js
+++ b/mail/app/profile/all-thunderbird.js
@@ -45,7 +45,6 @@ pref("browser.chromeURL", "chrome://messenger/content/messengercompose/messenger
 pref("mail.biff.animate_dock_icon", false);
 #endif
 
-pref("app.extensions.version", "1.0+");
 pref("update.app.enabled", true); // Whether or not app updates are enabled 
 pref("update.app.url", "chrome://mozapps/locale/update/update.properties");	
 pref("update.extensions.enabled", true);
diff --git a/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in b/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
index 9c9eccc40e179..eaa2f6d26a90c 100644
--- a/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
+++ b/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
@@ -43,6 +43,8 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
+DEFINES += -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION)
+
 FILES := \
 	install.rdf \
 	$(NULL)
diff --git a/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in b/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
index d4b1d6a0e74a9..9a4db42d8a02d 100644
--- a/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
+++ b/mail/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in
@@ -1,5 +1,7 @@
 <?xml version="1.0"?>
 
+#filter substitution
+
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
 
@@ -12,8 +14,8 @@
     <em:targetApplication>
       <Description>
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
-        <em:minVersion>1.0+</em:minVersion>
-        <em:maxVersion>1.0+</em:maxVersion>
+        <em:minVersion>@THUNDERBIRD_VERSION@</em:minVersion>
+        <em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
       </Description>
     </em:targetApplication>
     
diff --git a/xulrunner/examples/simple/application.ini b/xulrunner/examples/simple/application.ini
index 17368c5e66384..fa2cd67966a7d 100644
--- a/xulrunner/examples/simple/application.ini
+++ b/xulrunner/examples/simple/application.ini
@@ -27,15 +27,13 @@ ID={3aea3f07-ffe3-4060-bb03-bff3a5365e90}
 [Gecko]
 ;
 ; This field is required.  It specifies the minimum Gecko version that this
-; application requires.  Specifying 1.8 matches all releases with a version
-; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MinVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@
+; application requires.
+MinVersion=@MOZILLA_VERSION_U@
 ;
 ; This field is optional.  It specifies the maximum Gecko version that this
 ; application requires.  It should be specified if your application uses
-; unfrozen interfaces.  Specifying 1.8 matches all releases with a version
-; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
-MaxVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@
+; unfrozen interfaces.
+MaxVersion=@MOZILLA_VERSION_U@
 
 [Shell]
 ;
-- 
GitLab