From 3b576bc5d11c6abba86d0e87dd0f87317108e274 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Wed, 7 Apr 2010 12:44:38 -0700 Subject: [PATCH] Bug 543150 - Eliminate platform.ini checking in XRE_main, r=bsmedberg --HG-- extra : rebase_source : 66d7259ae79d9df6e68f00fb29d2766bc14128a8 --- toolkit/xre/Makefile.in | 7 +++++++ toolkit/xre/nsAppRunner.cpp | 30 ++---------------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in index 058067ed058a..2dc74aafbf87 100644 --- a/toolkit/xre/Makefile.in +++ b/toolkit/xre/Makefile.in @@ -250,6 +250,13 @@ INIARGS += --sourcerepo=$(SOURCE_REPO) endif endif +GRE_MILESTONE := $(shell tail -n 1 $(topsrcdir)/config/milestone.txt) +GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid) + +DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID) + +$(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt + platform.ini: FORCE $(PYTHON) $(srcdir)/make-platformini.py --buildid=$(shell cat $(DEPTH)/config/buildid) $(INIARGS) $(topsrcdir)/config/milestone.txt > $@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 93b5143d7703..35832b426d7e 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -246,8 +246,8 @@ extern void InstallSignalHandlers(const char *ProgramName); int gArgc; char **gArgv; -static char gToolkitVersion[20]; -static char gToolkitBuildID[40]; +static const char gToolkitVersion[] = NS_STRINGIFY(GRE_MILESTONE); +static const char gToolkitBuildID[] = NS_STRINGIFY(GRE_BUILDID); static int gRestartArgc; static char **gRestartArgv; @@ -2846,32 +2846,6 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) return 2; } - nsCOMPtr iniFile; - rv = appData.xreDirectory->Clone(getter_AddRefs(iniFile)); - if (NS_FAILED(rv)) - return 2; - - iniFile->AppendNative(NS_LITERAL_CSTRING("platform.ini")); - - nsCOMPtr localIniFile = do_QueryInterface(iniFile); - if (!localIniFile) - return 2; - - nsINIParser parser; - rv = parser.Init(localIniFile); - if (NS_SUCCEEDED(rv)) { - rv = parser.GetString("Build", "Milestone", - gToolkitVersion, sizeof(gToolkitVersion)); - NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get toolkit version"); - - rv = parser.GetString("Build", "BuildID", - gToolkitBuildID, sizeof(gToolkitBuildID)); - NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get toolkit buildid"); - } - else { - NS_ERROR("Couldn't parse platform.ini!"); - } - if (appData.size > offsetof(nsXREAppData, minVersion)) { if (!appData.minVersion) { Output(PR_TRUE, "Error: Gecko:MinVersion not specified in application.ini\n");