Bug 543150 - Eliminate platform.ini checking in XRE_main, r=bsmedberg

--HG--
extra : rebase_source : 66d7259ae79d9df6e68f00fb29d2766bc14128a8
This commit is contained in:
Michael Wu 2010-04-07 12:44:38 -07:00
parent 4f7ff65327
commit 3b576bc5d1
2 changed files with 9 additions and 28 deletions

View File

@ -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 > $@

View File

@ -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<nsIFile> iniFile;
rv = appData.xreDirectory->Clone(getter_AddRefs(iniFile));
if (NS_FAILED(rv))
return 2;
iniFile->AppendNative(NS_LITERAL_CSTRING("platform.ini"));
nsCOMPtr<nsILocalFile> 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");