Reverting bug 383167 again for linux test bustage :-(

This commit is contained in:
benjamin%smedbergs.us 2007-06-26 19:22:55 +00:00
Родитель 3a67fb98bb
Коммит 42c7e1c6b1
50 изменённых файлов: 343 добавлений и 2886 удалений

Просмотреть файл

@ -203,4 +203,4 @@ deliver: splitsymbols rebase signnss
endif # WINNT
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
BUILDID = $(shell cat $(DEPTH)/config/build_number)

Просмотреть файл

@ -65,16 +65,27 @@ DEFINES += -DAPP_VERSION="$(APP_VERSION)"
APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
DEFINES += -DAPP_UA_NAME="$(APP_UA_NAME)"
ifdef LIBXUL_SDK
# Build application.ini for a XULRunner app
DIST_FILES = application.ini
GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
# GRE_BUILD_ID is only available in nsBuildID.h in a form that we can't use
# directly. So munge it. Beware makefile and shell escaping
AWK_EXPR = '/\#define GRE_BUILD_ID/ { gsub(/"/, "", $$3); print $$3 }'
AWK_CMD = awk $(AWK_EXPR) < $(LIBXUL_DIST)/include/nsBuildID.h
DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
GRE_BUILD_ID = $(shell $(AWK_CMD))
ifndef LIBXUL_SDK
DEFINES += -DGRE_BUILD_ID=$(GRE_BUILD_ID)
include $(topsrcdir)/config/rules.mk
else
# Build a binary bootstrapping with XRE_main
MOZILLA_INTERNAL_API = 1
ifeq ($(USE_SHORT_LIBNAME), 1)
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
else
@ -83,7 +94,6 @@ endif
REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)
@ -110,18 +120,11 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
ifdef MOZ_ENABLE_LIBXUL
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
else
MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(EXTRA_DSO_LIBS) \
$(MOZ_JS_LIBS) \
$(APP_XPCOM_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)

Просмотреть файл

@ -40,24 +40,18 @@
Vendor=Mozilla
Name=Firefox
Version=@APP_VERSION@
BuildID=@GRE_BUILDID@
BuildID=@BUILD_ID@
Copyright=Copyright (c) 1998 - 2007 mozilla.org
ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
[Gecko]
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
MinVersion=@GRE_BUILD_ID@
MaxVersion=@GRE_BUILD_ID@
[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1
[Crash Reporter]
#if MOZILLA_OFFICIAL
#if XP_WIN
Enabled=1
#elif XP_MACOSX
Enabled=1
#endif
#endif
Enabled=0
ServerURL=https://crash-reports.mozilla.com/submit

Просмотреть файл

@ -41,52 +41,32 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"
#include <stdio.h>
#include <stdarg.h>
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsStringGlue.h"
static void Output(const char *fmt, ... )
{
va_list ap;
va_start(ap, fmt);
#if defined(XP_WIN) && !MOZ_WINCONSOLE
char msg[2048];
vsnprintf(msg, sizeof(msg), fmt, ap);
MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
#else
vfprintf(stderr, fmt, ap);
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
nsnull,
"Mozilla",
"Firefox",
NS_STRINGIFY(APP_VERSION),
NS_STRINGIFY(BUILD_ID),
"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
"Copyright (c) 1998 - 2007 mozilla.org",
NS_XRE_ENABLE_PROFILE_MIGRATOR |
NS_XRE_ENABLE_EXTENSION_MANAGER
#if defined(MOZILLA_OFFICIAL) && (defined(XP_WIN) || defined(XP_MACOSX))
| NS_XRE_ENABLE_CRASH_REPORTER
#endif
va_end(ap);
}
,
nsnull, // xreDirectory
nsnull, // minVersion
nsnull, // maxVersion
"https://crash-reports.mozilla.com/submit"
};
int main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
if (NS_FAILED(rv)) {
Output("Couldn't calculate the application directory.");
return 255;
}
appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
nsXREAppData *appData;
rv = XRE_CreateAppData(appini, &appData);
if (NS_FAILED(rv)) {
Output("Couldn't read application.ini");
return 255;
}
int result = XRE_main(argc, argv, appData);
XRE_FreeAppData(appData);
return result;
return XRE_main(argc, argv, &kAppData);
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -45,8 +45,6 @@ bin/components/libjar50.so
; [Base Browser Files]
bin/@MOZ_APP_NAME@-bin
bin/@MOZ_APP_NAME@
bin/application.ini
bin/platform.ini
bin/mozilla-xremote-client
bin/run-mozilla.sh
bin/plugins/libnullplugin.so

Просмотреть файл

@ -48,8 +48,6 @@ bin\msvcr80.dll
[browser]
; [Base Browser Files]
bin\@MOZ_APP_NAME@.exe
bin\application.ini
bin\platform.ini
bin\plugins\npnul32.dll
bin\res\cmessage.txt
bin\res\effective_tld_names.dat

Просмотреть файл

@ -457,7 +457,6 @@ ifndef MAKE
MAKE := gmake
endif
PERL ?= perl
PYTHON ?= python
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
ifdef CONFIG_GUESS_SCRIPT
@ -941,7 +940,7 @@ else
ifdef MOZ_UNIFY_BDATE
ifndef MOZ_BUILD_DATE
ifdef MOZ_BUILD_PROJECTS
MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
MOZ_BUILD_DATE = $(shell $(PERL) -I$(TOPSRCDIR)/config $(TOPSRCDIR)/config/bdate.pl)
export MOZ_BUILD_DATE
endif
endif

Просмотреть файл

@ -59,6 +59,9 @@ PLSRCS = nfspwd.pl revdepth.pl
TARGETS = $(HOST_PROGRAM) $(PLSRCS:.pl=) $(SIMPLE_PROGRAMS)
# Generate the build number on the fly.
TARGETS += build_number nsBuildID.h
ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
TARGETS += elf-dynstr-gc
@ -93,6 +96,7 @@ NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif
HEADERS = \
nsBuildID.h \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
@ -119,12 +123,35 @@ export::
$(INSTALL) system_wrappers $(DIST)/include
endif
# we don't use an explicit dependency here because then we would
# regenerate nsBuildID.h during the make install phase and that would
# be bad.
install::
@if test ! -f nsBuildID.h; then\
echo "You must have done at least a make export before trying to do a make install."; \
echo "(nsBuildID.h is missing.)"; \
exit 1; \
fi;
$(SYSINSTALL) $(IFLAGS1) $(DEPTH)/mozilla-config.h $(DESTDIR)$(includedir)
GARBAGE += \
GARBAGE += build_number nsBuildID \
$(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES)
ifneq (,$(BUILD_OFFICIAL)$(MOZILLA_OFFICIAL))
_BN_OFFICIAL=1
else
_BN_OFFICIAL=
endif
build_number: FORCE
$(PERL) -I$(srcdir) $(srcdir)/bdate.pl $@ $(_BN_OFFICIAL)
nsBuildID.h: nsBuildID.h.in build_number $(srcdir)/milestone.txt Makefile
$(RM) $@
MOZ_MILESTONE_RELEASE=$(MOZ_MILESTONE_RELEASE); \
export MOZ_MILESTONE_RELEASE; \
$(PERL) -I$(srcdir) $(srcdir)/aboutime.pl -m $(srcdir)/milestone.txt $@ build_number $(srcdir)/nsBuildID.h.in
ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
elf-dynstr-gc: elf-dynstr-gc.c Makefile Makefile.in

0
config/aboutime.pl Executable file
Просмотреть файл

0
config/bdate.c Normal file
Просмотреть файл

0
config/bdate.pl Executable file
Просмотреть файл

0
config/build-number.pl Normal file
Просмотреть файл

Просмотреть файл

@ -871,6 +871,12 @@ ifdef LOCALE_SRCDIR
MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
endif
#
# Add BUILD_ID to set of DEFINES
#
BUILD_ID := $(shell cat $(DEPTH)/config/build_number)
DEFINES += -DBUILD_ID=$(BUILD_ID)
ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

0
config/mozBDate.pm Executable file
Просмотреть файл

Просмотреть файл

@ -1,21 +0,0 @@
import configobj, sys
try:
(file, section, key) = sys.argv[1:]
except ValueError:
print "Usage: printconfigsetting.py <file> <section> <setting>"
sys.exit(1)
c = configobj.ConfigObj(file)
try:
s = c[section]
except KeyError:
print >>sys.stderr, "Section [%s] not found." % section
sys.exit(1)
try:
print s[key]
except KeyError:
print >>sys.stderr, "Key %s not found." % key
sys.exit(1)

Просмотреть файл

@ -138,6 +138,7 @@ if ($bits eq "16") { $fileos="VOS__WINDOWS16"; }
my $bufferstr=" ";
my $MILESTONE_FILE = "$topsrcdir/config/milestone.txt";
my $BUILDID_FILE = "$depth/config/build_number";
#Read module.ver file
#Version file overrides for WIN32:
@ -242,7 +243,17 @@ if ($official eq "1") {
}
$mfversion = $mpversion = "$milestone";
my ($buildid, $buildid_hi, $buildid_lo);
open(NUMBER, "<$BUILDID_FILE") || die "No build number file\n";
while ( <NUMBER> ) { $buildid = $_ }
close (NUMBER);
$buildid =~ s/^\s*(.*)\s*$/$1/;
$buildid_hi = substr($buildid, 0, 5);
$buildid_lo = substr($buildid, 5);
$mfversion = $mpversion = "$milestone: $buildid";
my @pvarray = split(',', $productversion);
$fileversion = "$pvarray[0],$pvarray[1],$buildid_hi,$buildid_lo";
}
my $copyright = "License: MPL 1.1/GPL 2.0/LGPL 2.1";
@ -379,6 +390,7 @@ print RCFILE qq{
//
1 VERSIONINFO
FILEVERSION $fileversion
PRODUCTVERSION $productversion
FILEFLAGSMASK 0x3fL
FILEFLAGS $fileflags

Просмотреть файл

@ -157,7 +157,6 @@
#include "nsCDefaultURIFixup.h"
#include "nsEventDispatcher.h"
#include "nsIObserverService.h"
#include "nsIXULAppInfo.h"
#include "nsNetUtil.h"
#include "plbase64.h"
@ -194,6 +193,8 @@
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
#include "nsBuildID.h"
nsIFactory *nsGlobalWindow::sComputedDOMStyleFactory = nsnull;
static nsIEntropyCollector *gEntropyCollector = nsnull;
@ -8246,18 +8247,8 @@ nsNavigator::GetOnLine(PRBool* aOnline)
NS_IMETHODIMP
nsNavigator::GetBuildID(nsAString& aBuildID)
{
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (!appInfo)
return NS_ERROR_NOT_IMPLEMENTED;
aBuildID = NS_LITERAL_STRING(NS_STRINGIFY(NS_BUILD_ID));
nsCAutoString buildID;
nsresult rv = appInfo->GetAppBuildID(buildID);
if (NS_FAILED(rv))
return rv;
aBuildID.Truncate();
AppendASCIItoUTF16(buildID, aBuildID);
return NS_OK;
}

Просмотреть файл

@ -73,6 +73,10 @@
#include "nsCRT.h"
#include "nsFontMetricsPS.h"
#ifndef NS_BUILD_ID
#include "nsBuildID.h"
#endif /* !NS_BUILD_ID */
#include "nsPrintfCString.h"
#include "prenv.h"
@ -409,8 +413,8 @@ nsPostScriptObj::write_prolog(FILE *aHandle, PRBool aFTPEnable)
fpCString(fWidth).get(),
fpCString(fHeight).get());
fprintf(f, "%%%%Creator: Mozilla PostScript module (%s)\n",
"rv:" MOZILLA_VERSION);
fprintf(f, "%%%%Creator: Mozilla PostScript module (%s/%lu)\n",
"rv:" MOZILLA_VERSION, (unsigned long)NS_BUILD_ID);
fprintf(f, "%%%%DocumentData: Clean8Bit\n");
fprintf(f, "%%%%DocumentPaperSizes: %s\n", mPrintSetup->paper_name);
fprintf(f, "%%%%Orientation: %s\n",

Просмотреть файл

@ -50,6 +50,9 @@ ifeq ($(OS_ARCH),OSF1)
SHELL := ksh
endif
BUILD_DATE = gbdate.h
BUILD_DATE_TS = gbdate.tstamp
MODULE = layout
LIBRARY_NAME = gklayout
EXPORT_LIBRARY = 1
@ -109,6 +112,7 @@ endif
CPPSRCS = \
nsLayoutModule.cpp \
nsContentHTTPStartup.cpp \
nsContentDLF.cpp \
nsLayoutStatics.cpp \
$(NULL)
@ -294,8 +298,24 @@ endif
DEFINES += -D_IMPL_NS_LAYOUT
GARBAGE += $(BUILD_DATE) $(BUILD_DATE_TS)
ifeq ($(OS_ARCH),IRIX)
ifeq ($(GNU_CXX),1)
LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=50
endif
endif
export:: $(BUILD_DATE)
$(BUILD_DATE_TS): FORCE
@for f in $(SHARED_LIBRARY_LIBS); do \
if [ $$f -nt $@ ]; then \
touch $@; \
fi; \
done
$(BUILD_DATE):: gbdate.pl $(BUILD_DATE_TS)
$(RM) $@
$(PERL) $(srcdir)/gbdate.pl > $@

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -38,6 +38,7 @@
#include "nsLayoutStatics.h"
#include "nsContentCID.h"
#include "nsContentHTTPStartup.h"
#include "nsContentDLF.h"
#include "nsContentPolicyUtils.h"
#include "nsDataDocumentContentPolicy.h"
@ -516,6 +517,7 @@ MAKE_CTOR(CreateXULPopupListener, nsIXULPopupListener, NS_NewXUL
MAKE_CTOR(CreateXTFService, nsIXTFService, NS_NewXTFService)
MAKE_CTOR(CreateXMLContentBuilder, nsIXMLContentBuilder, NS_NewXMLContentBuilder)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsContentHTTPStartup)
MAKE_CTOR(CreateContentDLF, nsIDocumentLoaderFactory, NS_NewContentDocumentLoaderFactory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCSSOMFactory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsInspectorCSSUtils)
@ -1216,6 +1218,13 @@ static const nsModuleComponentInfo gComponents[] = {
CreateXMLContentBuilder },
#endif
{ "Content HTTP Startup Listener",
NS_CONTENTHTTPSTARTUP_CID,
NS_CONTENTHTTPSTARTUP_CONTRACTID,
nsContentHTTPStartupConstructor,
nsContentHTTPStartup::RegisterHTTPStartup,
nsContentHTTPStartup::UnregisterHTTPStartup },
{ "Document Loader Factory",
NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID,
"@mozilla.org/content/document-loader-factory;1",

Просмотреть файл

@ -42,17 +42,11 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MOZILLA_INTERNAL_API = 1
AB_CD = $(MOZ_UI_LOCALE)
GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
DEFINES += \
-DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" \
-DAB_CD=$(AB_CD) \
-DGRE_MILESTONE=$(GRE_MILESTONE) \
-DGRE_BUILDID=$(GRE_BUILDID) \
$(NULL)
DEFINES += -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" -DAB_CD=$(AB_CD)
DIRS = profile
@ -73,14 +67,11 @@ endif
REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)
CPPSRCS = nsMailApp.cpp
DIST_FILES = application.ini
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifdef BUILD_STATIC_LIBS
@ -102,18 +93,11 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
ifdef MOZ_ENABLE_LIBXUL
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
else
MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(MOZ_JS_LIBS) \
$(EXTRA_DSO_LIBS) \
$(APP_XPCOM_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)

Просмотреть файл

@ -1,55 +0,0 @@
; ***** 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
; the License. You may obtain a copy of the License at
; http://www.mozilla.org/MPL/
;
; Software distributed under the License is distributed on an "AS IS" basis,
; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
; for the specific language governing rights and limitations under the
; License.
;
; The Original Code is Mozilla Firefox.
;
; The Initial Developer of the Original Code is
; Benjamin Smedberg <benjamin@smedbergs.us>.
;
; Portions created by the Initial Developer are Copyright (C) 2006
; the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
;
; Contributor(s):
;
; 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
; decision by deleting the provisions above and replace them with the notice
; and other provisions required by the GPL or the LGPL. If you do not delete
; 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 *****
#filter substitution
[App]
Name=Thunderbird
Version=@APP_VERSION@
BuildID=@GRE_BUILDID@
Copyright=Copyright (c) 1998-2007 mozilla.org
ID={3550f703-e582-4d05-9a08-453d09bdfdc6}
[Gecko]
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1
[Crash Reporter]
ServerURL=https://crash-reports.mozilla.com/submit

Просмотреть файл

@ -41,52 +41,29 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"
#include "prtypes.h"
#include <stdio.h>
#include <stdarg.h>
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsStringGlue.h"
static void Output(const char *fmt, ... )
{
va_list ap;
va_start(ap, fmt);
#if defined(XP_WIN) && !MOZ_WINCONSOLE
char msg[2048];
vsnprintf(msg, sizeof(msg), fmt, ap);
MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
#else
vfprintf(stderr, fmt, ap);
#endif
va_end(ap);
}
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
nsnull,
nsnull,
"Thunderbird",
NS_STRINGIFY(APP_VERSION),
NS_STRINGIFY(BUILD_ID),
"{3550f703-e582-4d05-9a08-453d09bdfdc6}",
"Copyright (c) 1998-2007 mozilla.org",
NS_XRE_ENABLE_PROFILE_MIGRATOR |
NS_XRE_ENABLE_EXTENSION_MANAGER,
nsnull, // xreDirectory
nsnull, // minVersion
nsnull, // maxVersion
"https://crash-reports.mozilla.com/submit"
};
int main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
if (NS_FAILED(rv)) {
Output("Couldn't calculate the application directory.");
return 255;
}
appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
nsXREAppData *appData;
rv = XRE_CreateAppData(appini, &appData);
if (NS_FAILED(rv)) {
Output("Couldn't read application.ini");
return 255;
}
int result = XRE_main(argc, argv, appData);
XRE_FreeAppData(appData);
return result;
return XRE_main(argc, argv, &kAppData);
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -60,8 +60,6 @@ bin\extensions\talkback@mozilla.org\components\talkback.hlp
bin\xpicleanup.exe
bin\thunderbird.exe
bin\application.ini
bin\platform.ini
bin\LICENSE.txt
bin\license.html
bin\README.txt

Просмотреть файл

@ -606,10 +606,17 @@ int strncasecmp(const char *str1, const char *str2, int length)
#include "NSReg.h"
#include "VerReg.h"
#include "nsBuildID.h"
char *TheRegistry = "registry";
char *Flist;
/* WARNING: build hackery */
#if defined(STANDALONE_REGISTRY) && !defined(XP_MAC) && !defined(XP_MACOSX)
long BUILDNUM = NS_BUILD_ID;
#endif
REGERR vr_ParseVersion(char *verstr, VERSION *result);
#if defined(XP_UNIX) && !defined(XP_MACOSX)

Просмотреть файл

@ -75,8 +75,6 @@
#include "nsNetUtil.h"
#include "nsIOService.h"
#include "nsIXULAppInfo.h"
#if defined(XP_UNIX) || defined(XP_BEOS)
#include <sys/utsname.h>
#endif
@ -166,7 +164,6 @@ nsHttpHandler::nsHttpHandler()
, mPhishyUserPassLength(1)
, mLastUniqueID(NowInSeconds())
, mSessionStartTime(0)
, mProduct("Gecko")
, mUserAgentIsDirty(PR_TRUE)
, mUseCache(PR_TRUE)
, mSendSecureXSiteReferrer(PR_TRUE)
@ -261,11 +258,6 @@ nsHttpHandler::Init()
rv = InitConnectionMgr();
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (appInfo)
appInfo->GetPlatformBuildID(mProductSub);
// Startup the http category
// Bring alive the objects in the http-protocol-startup category
NS_CreateServicesFromCategory(NS_HTTP_STARTUP_CATEGORY,
@ -824,6 +816,16 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
}
// Gather product values.
if (PREF_CHANGED(UA_PREF("product"))) {
prefs->GetCharPref(UA_PREF_PREFIX "product",
getter_Copies(mProduct));
mUserAgentIsDirty = PR_TRUE;
}
if (PREF_CHANGED(UA_PREF("productSub"))) {
prefs->GetCharPref(UA_PREF("productSub"),
getter_Copies(mProductSub));
mUserAgentIsDirty = PR_TRUE;
}
if (PREF_CHANGED(UA_PREF("productComment"))) {
prefs->GetCharPref(UA_PREF("productComment"),
getter_Copies(mProductComment));

Просмотреть файл

@ -284,7 +284,7 @@ private:
nsXPIDLCString mVendor;
nsXPIDLCString mVendorSub;
nsXPIDLCString mVendorComment;
nsCString mProduct;
nsXPIDLCString mProduct;
nsXPIDLCString mProductSub;
nsXPIDLCString mProductComment;
nsCString mExtraUA;

Просмотреть файл

@ -42,16 +42,13 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
AB_CD = $(MOZ_UI_LOCALE)
MOZILLA_INTERNAL_API = 1
GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
AB_CD = $(MOZ_UI_LOCALE)
DEFINES += \
-DAB_CD=$(AB_CD) \
-DAPP_VERSION="$(MOZ_APP_VERSION)" \
-DGRE_MILESTONE=$(GRE_MILESTONE) \
-DGRE_BUILDID=$(GRE_BUILDID) \
$(NULL)
ifeq ($(USE_SHORT_LIBNAME), 1)
@ -62,14 +59,11 @@ endif
REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)
CPPSRCS = nsSuiteApp.cpp
DIST_FILES = application.ini
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifdef BUILD_STATIC_LIBS
@ -91,18 +85,11 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
ifdef MOZ_ENABLE_LIBXUL
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
else
MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif
LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(MOZ_JS_LIBS) \
$(EXTRA_DSO_LIBS) \
$(APP_XPCOM_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)

Просмотреть файл

@ -1,53 +0,0 @@
; ***** 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
; the License. You may obtain a copy of the License at
; http://www.mozilla.org/MPL/
;
; Software distributed under the License is distributed on an "AS IS" basis,
; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
; for the specific language governing rights and limitations under the
; License.
;
; The Original Code is Mozilla Firefox.
;
; The Initial Developer of the Original Code is
; Benjamin Smedberg <benjamin@smedbergs.us>.
;
; Portions created by the Initial Developer are Copyright (C) 2006
; the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
;
; Contributor(s):
;
; 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
; decision by deleting the provisions above and replace them with the notice
; and other provisions required by the GPL or the LGPL. If you do not delete
; 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 *****
#filter substitution
[App]
Vendor=mozilla.org
Name=SeaMonkey
Version=@APP_VERSION@
BuildID=@GRE_BUILDID@
Copyright=Copyright (c) 1998-2007 mozilla.org
ID={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
[Gecko]
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1

Просмотреть файл

@ -15,12 +15,12 @@
* 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) 2002
* the mozilla.org SeaMonkey project.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Brian Ryner <bryner@brianryner.com>
* Mark Banner <bugzilla@standard8.demon.co.uk>
*
* 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
@ -41,52 +41,25 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"
#include "prtypes.h"
#include <stdio.h>
#include <stdarg.h>
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsStringGlue.h"
static void Output(const char *fmt, ... )
{
va_list ap;
va_start(ap, fmt);
#if defined(XP_WIN) && !MOZ_WINCONSOLE
char msg[2048];
vsnprintf(msg, sizeof(msg), fmt, ap);
MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
#else
vfprintf(stderr, fmt, ap);
#endif
va_end(ap);
}
static const nsXREAppData kAppData = {
offsetof(nsXREAppData, xreDirectory),
nsnull,
"mozilla.org",
"SeaMonkey",
NS_STRINGIFY(APP_VERSION),
NS_STRINGIFY(BUILD_ID),
"{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}",
"Copyright (c) 1998-2007 mozilla.org",
NS_XRE_ENABLE_PROFILE_MIGRATOR |
NS_XRE_ENABLE_EXTENSION_MANAGER
};
int main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
if (NS_FAILED(rv)) {
Output("Couldn't calculate the application directory.");
return 255;
}
appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
nsXREAppData *appData;
rv = XRE_CreateAppData(appini, &appData);
if (NS_FAILED(rv)) {
Output("Couldn't read application.ini");
return 255;
}
int result = XRE_main(argc, argv, appData);
XRE_FreeAppData(appData);
return result;
return XRE_main(argc, argv, &kAppData);
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)
@ -94,7 +67,7 @@ int main(int argc, char* argv[])
// unused if we are a console application.
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int )
{
// Do the real work.
return main( __argc, __argv );
// Do the real work.
return main( __argc, __argv );
}
#endif

Просмотреть файл

@ -59,8 +59,6 @@ bin\README.txt,bin\readme.txt
bin\LICENSE,bin\license.txt
bin\jpeg3250.dll
bin\seamonkey.exe
bin\application.ini
bin\platform.ini
bin\regxpcom.exe
bin\xpicleanup.exe
bin\jsj3250.dll

Просмотреть файл

@ -93,6 +93,7 @@ FORCE_STATIC_LIB = 1
XPIDLSRCS = \
nsINativeAppSupport.idl \
nsIXULAppInfo.idl \
nsIXULRuntime.idl \
$(NULL)
@ -252,12 +253,3 @@ endif
export:: $(addprefix $(topsrcdir)/xpfe/bootstrap/, $(SHAREDCPPSRCS)) $(STACKWALK_CPPSRCS)
$(INSTALL) $^ .
platform.ini: FORCE
$(PYTHON) $(srcdir)/make-platformini.py $(topsrcdir)/config/milestone.txt > $@
libs:: platform.ini
$(INSTALL) $^ $(DIST)/bin
install::
$(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)

Просмотреть файл

@ -1,31 +0,0 @@
#!/usr/bin/python
from optparse import OptionParser
from datetime import datetime
import sys
import os
o = OptionParser()
o.add_option("--print-buildid", action="store_true", dest="print_buildid")
(options, args) = o.parse_args()
buildid = os.environ.get('MOZ_BUILD_DATE', datetime.now().strftime('%Y%m%d%H'))
if options.print_buildid:
print buildid
sys.exit(0)
(milestoneFile,) = args
for line in open(milestoneFile, 'r'):
if line[0] == '#':
continue
line = line.strip()
if line == '':
continue
milestone = line
print """[Build]
BuildID=%s
Milestone=%s""" % (buildid, milestone)

Просмотреть файл

@ -46,6 +46,7 @@
#include "nsAppRunner.h"
#include "nsUpdateDriver.h"
#include "nsBuildID.h"
#ifdef XP_MACOSX
#include "MacLaunchHelper.h"
@ -264,9 +265,6 @@ extern "C" {
int gArgc;
char **gArgv;
static char gToolkitVersion[20];
static char gToolkitBuildID[40];
static int gRestartArgc;
static char **gRestartArgv;
@ -575,7 +573,7 @@ nsXULAppInfo::GetVersion(nsACString& aResult)
NS_IMETHODIMP
nsXULAppInfo::GetPlatformVersion(nsACString& aResult)
{
aResult.AssignLiteral(gToolkitVersion);
aResult.AssignLiteral(TOOLKIT_EM_VERSION);
return NS_OK;
}
@ -591,7 +589,7 @@ nsXULAppInfo::GetAppBuildID(nsACString& aResult)
NS_IMETHODIMP
nsXULAppInfo::GetPlatformBuildID(nsACString& aResult)
{
aResult.Assign(gToolkitBuildID);
aResult.Assign(NS_STRINGIFY(BUILD_ID));
return NS_OK;
}
@ -1938,7 +1936,7 @@ static void BuildVersion(nsCString &aBuf)
aBuf.Append('_');
aBuf.Append(gAppData->buildID);
aBuf.Append('/');
aBuf.Append(gToolkitBuildID);
aBuf.AppendLiteral(GRE_BUILD_ID);
}
static void
@ -2263,6 +2261,27 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
return 1;
}
if (appData.size > offsetof(nsXREAppData, minVersion)) {
if (!appData.minVersion) {
Output(PR_TRUE, "Error: Gecko:MinVersion not specified in application.ini\n");
return 1;
}
if (!appData.maxVersion) {
// If no maxVersion is specified, we assume the app is only compatible
// with the initial preview release. Do not increment this number ever!
SetAllocatedString(appData.maxVersion, "1.*");
}
if (NS_CompareVersions(appData.minVersion, TOOLKIT_EM_VERSION) > 0 ||
NS_CompareVersions(appData.maxVersion, TOOLKIT_EM_VERSION) < 0) {
Output(PR_TRUE, "Error: Platform version " TOOLKIT_EM_VERSION " is not compatible with\n"
"minVersion >= %s\nmaxVersion <= %s\n",
appData.minVersion, appData.maxVersion);
return 1;
}
}
ScopedLogging log;
if (!appData.xreDirectory) {
@ -2281,54 +2300,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");
return 1;
}
if (!appData.maxVersion) {
// If no maxVersion is specified, we assume the app is only compatible
// with the initial preview release. Do not increment this number ever!
SetAllocatedString(appData.maxVersion, "1.*");
}
if (NS_CompareVersions(appData.minVersion, gToolkitVersion) > 0 ||
NS_CompareVersions(appData.maxVersion, gToolkitVersion) < 0) {
Output(PR_TRUE, "Error: Platform version '%s' is not compatible with\n"
"minVersion >= %s\nmaxVersion <= %s\n",
gToolkitVersion,
appData.minVersion, appData.maxVersion);
return 1;
}
}
#ifdef MOZ_AIRBAG
const char* airbagEnv = PR_GetEnv("MOZ_CRASHREPORTER");
if (airbagEnv && *airbagEnv) {

Просмотреть файл

Просмотреть файл

@ -84,6 +84,7 @@ CSRCS = \
CPPSRCS = \
$(XPCOM_GLUE_SRC_LCPPSRCS) \
nsXPCOMGlue.cpp \
nsGREDirServiceProvider.cpp \
$(LINKSRC) \
$(NULL)

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -42,6 +42,7 @@
#include "nspr.h"
#include "nsDebug.h"
#include "nsIServiceManager.h"
#include "nsGREDirServiceProvider.h"
#include "nsXPCOMPrivate.h"
#include "nsCOMPtr.h"
#include <stdlib.h>
@ -517,3 +518,68 @@ NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
return xpcomFunctions.invokeByIndexFunc(that, methodIndex,
paramCount, params);
}
// Default GRE startup/shutdown code
extern "C"
nsresult GRE_Startup()
{
const char* xpcomLocation = GRE_GetXPCOMPath();
// Startup the XPCOM Glue that links us up with XPCOM.
nsresult rv = XPCOMGlueStartup(xpcomLocation);
if (NS_FAILED(rv)) {
NS_WARNING("gre: XPCOMGlueStartup failed");
return rv;
}
#ifdef XP_WIN
// On windows we have legacy GRE code that does not load the GRE dependent
// libs (seamonkey GRE, not libxul)... add the GRE to the PATH.
// See bug 301043.
const char *lastSlash = strrchr(xpcomLocation, '\\');
if (lastSlash) {
int xpcomPathLen = lastSlash - xpcomLocation;
DWORD pathLen = GetEnvironmentVariable("PATH", nsnull, 0);
char *newPath = (char*) _alloca(xpcomPathLen + pathLen + 1);
strncpy(newPath, xpcomLocation, xpcomPathLen);
// in case GetEnvironmentVariable fails
newPath[xpcomPathLen] = ';';
newPath[xpcomPathLen + 1] = '\0';
GetEnvironmentVariable("PATH", newPath + xpcomPathLen + 1, pathLen);
SetEnvironmentVariable("PATH", newPath);
}
#endif
nsGREDirServiceProvider *provider = new nsGREDirServiceProvider();
if ( !provider ) {
NS_WARNING("GRE_Startup failed");
XPCOMGlueShutdown();
return NS_ERROR_OUT_OF_MEMORY;
}
nsCOMPtr<nsIServiceManager> servMan;
NS_ADDREF( provider );
rv = NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, provider);
NS_RELEASE(provider);
if ( NS_FAILED(rv) || !servMan) {
NS_WARNING("gre: NS_InitXPCOM failed");
XPCOMGlueShutdown();
return rv;
}
return NS_OK;
}
extern "C"
nsresult GRE_Shutdown()
{
NS_ShutdownXPCOM(nsnull);
XPCOMGlueShutdown();
return NS_OK;
}

Просмотреть файл

@ -127,5 +127,45 @@ XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols);
extern "C" NS_HIDDEN_(nsresult)
XPCOMGlueShutdown();
/**
* Locate the path of the XPCOM shared library of a compatible GRE.
* The result of this function is normally passed directly to
* XPCOMGlueStartup. This looks for the GRE version in
* nsBuildID.h, which is generated at build time. Unless you set
* MOZ_MILESTONE_RELEASE this will probably not be a useful GRE version string.
*
* @return string buffer pointing to the XPCOM DLL path. Callers do
* not need to free this buffer.
* @status DEPRECATED - Use GRE_GetGREPathWithProperties
*/
extern "C" NS_HIDDEN_(char const *)
GRE_GetXPCOMPath();
/**
* Locate the directory of a compatible GRE as an nsIFile
*
* @param _retval Ordinary XPCOM getter, returns an addrefed interface.
*/
extern "C" NS_HIDDEN_(nsresult)
GRE_GetGREDirectory(nsILocalFile* *_retval);
/**
* Embedding applications which don't need a custom
* directoryserviceprovider may use GRE_Startup to start the XPCOM
* glue and initialize the GRE in one step.
*/
extern "C" NS_HIDDEN_(nsresult)
GRE_Startup();
/**
* Shut down XPCOM and the XPCOM glue in one step.
*/
extern "C" NS_HIDDEN_(nsresult)
GRE_Shutdown();
#endif // XPCOM_GLUE
#endif // nsXPCOMGlue_h__

Просмотреть файл

@ -45,7 +45,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xpcom
XPIDLSRCS = \
nsIXULAppInfo.idl \
nsIGConfService.idl \
nsIGnomeVFSService.idl \
$(NULL)

Просмотреть файл

@ -1,92 +0,0 @@
/* ***** 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
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is XUL bootstrap code.
*
* The Initial Developer of the Original Code is
* Benjamin Smedberg <benjamin@smedbergs.us>
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* 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 ***** */
#include "nsISupports.idl"
/**
* A scriptable interface to the nsXULAppAPI structure. See nsXULAppAPI.h for
* a detailed description of each attribute.
*
* @status FROZEN - This interface is frozen for use by embedders and will
* not change in the future.
*/
[scriptable, uuid(a61ede2a-ef09-11d9-a5ce-001124787b2e)]
interface nsIXULAppInfo : nsISupports
{
/**
* @see nsXREAppData.vendor
* @returns an empty string if nsXREAppData.vendor is not set.
*/
readonly attribute ACString vendor;
/**
* @see nsXREAppData.name
*/
readonly attribute ACString name;
/**
* @see nsXREAppData.ID
* @returns an empty string if nsXREAppData.ID is not set.
*/
readonly attribute ACString ID;
/**
* The version of the XUL application. It is different than the
* version of the XULRunner platform. Be careful about which one you want.
*
* @see nsXREAppData.version
* @returns an empty string if nsXREAppData.version is not set.
*/
readonly attribute ACString version;
/**
* The build ID/date of the application. For xulrunner applications,
* this will be different than the build ID of the platform. Be careful
* about which one you want.
*/
readonly attribute ACString appBuildID;
/**
* The version of the XULRunner platform.
*/
readonly attribute ACString platformVersion;
/**
* The build ID/date of gecko and the XULRunner platform.
*/
readonly attribute ACString platformBuildID;
};

Просмотреть файл

@ -41,6 +41,7 @@
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsBuildID.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsInstall.h"
@ -1855,6 +1856,8 @@ static JSConstDoubleSpec install_constants[] =
{ CHROME_DELAYED, "DELAYED_CHROME" },
{ CHROME_SELECT, "SELECT_CHROME" },
{ NS_BUILD_ID, "buildID" },
{0}
};

Просмотреть файл

@ -69,6 +69,7 @@
#include "nsTopProgressNotifier.h"
#include "nsLoggingProgressNotifier.h"
#include "nsBuildID.h"
#include "nsProcess.h"
/* For Javascript Namespace Access */

Просмотреть файл

@ -39,7 +39,6 @@
#define nsRegisterGRE_h__
#include "nscore.h"
#include "nsStringAPI.h"
class nsIFile;
struct GREProperty;
@ -53,9 +52,4 @@ RegisterXULRunner(PRBool aRegisterGlobally, nsIFile* aLocation,
NS_HIDDEN_(void)
UnregisterXULRunner(PRBool aUnregisterGlobally, nsIFile* aLocation);
// Shared helper function to get the GRE milestone and optionally buildid
// from platform.ini
NS_HIDDEN_(nsresult)
GetGREVersion(const char *argv0, nsACString *aMilestone, nsACString *aVersion);
#endif // nsRegisterGRE_h__

Просмотреть файл

@ -50,12 +50,12 @@
#include "nsCOMPtr.h"
#include "nsMemory.h"
#include "nsCRTGlue.h"
#include "nsBuildID.h"
#include "nsStringAPI.h"
#include "nsServiceManagerUtils.h"
#include "plstr.h"
#include "prprf.h"
#include "prenv.h"
#include "nsINIParser.h"
/**
* Output a string to the user. This method is really only meant to be used to
@ -110,11 +110,8 @@ static PRBool IsArg(const char* arg, const char* s)
return PR_FALSE;
}
static void Usage(const char *argv0)
static void Usage()
{
nsCAutoString milestone;
GetGREVersion(argv0, &milestone, nsnull);
// display additional information (XXX make localizable?)
Output(PR_FALSE,
"Mozilla XULRunner %s\n\n"
@ -142,7 +139,7 @@ static void Usage(const char *argv0)
"\n"
"APP-OPTIONS\n"
" Application specific options.\n",
milestone.get());
GRE_BUILD_ID);
}
static nsresult
@ -164,41 +161,6 @@ GetXULRunnerDir(const char *argv0, nsIFile* *aResult)
return rv;
}
nsresult
GetGREVersion(const char *argv0,
nsACString *aMilestone,
nsACString *aVersion)
{
if (aMilestone)
aMilestone->Assign("<Error>");
if (aVersion)
aVersion->Assign("<Error>");
nsCOMPtr<nsILocalFile> iniFile;
nsresult rv = XRE_GetBinaryPath(argv0, getter_AddRefs(iniFile));
if (NS_FAILED(rv))
return rv;
iniFile->SetNativeLeafName(NS_LITERAL_CSTRING("platform.ini"));
nsINIParser parser;
rv = parser.Init(iniFile);
if (NS_FAILED(rv))
return rv;
if (aMilestone) {
rv = parser.GetString("Build", "Milestone", *aMilestone);
if (NS_FAILED(rv))
return rv;
}
if (aVersion) {
rv = parser.GetString("Build", "BuildID", *aVersion);
if (NS_FAILED(rv))
return rv;
}
return NS_OK;
}
static int
InstallXULApp(nsIFile* aXULRunnerDir,
const char *aAppLocation,
@ -280,17 +242,13 @@ int main(int argc, char* argv[])
IsArg(argv[1], "help") ||
IsArg(argv[1], "?")))
{
Usage(argv[0]);
Usage();
return 0;
}
if (argc == 2 && (IsArg(argv[1], "v") || IsArg(argv[1], "version")))
{
nsCAutoString milestone;
nsCAutoString version;
GetGREVersion(argv[0], &milestone, &version);
Output(PR_FALSE, "Mozilla XULRunner %s - %s\n",
milestone.get(), version.get());
Output(PR_FALSE, "Mozilla XULRunner %s\n", GRE_BUILD_ID);
return 0;
}
@ -299,7 +257,7 @@ int main(int argc, char* argv[])
PRBool registerUser = IsArg(argv[1], "register-user");
if (registerGlobal || registerUser) {
if (argc != 2) {
Usage(argv[0]);
Usage();
return 1;
}
@ -317,7 +275,7 @@ int main(int argc, char* argv[])
registerUser = IsArg(argv[1], "unregister-user");
if (registerGlobal || registerUser) {
if (argc != 2) {
Usage(argv[0]);
Usage();
return 1;
}
@ -331,7 +289,7 @@ int main(int argc, char* argv[])
if (IsArg(argv[1], "find-gre")) {
if (argc != 3) {
Usage(argv[0]);
Usage();
return 1;
}
@ -356,21 +314,17 @@ int main(int argc, char* argv[])
if (IsArg(argv[1], "gre-version")) {
if (argc != 2) {
Usage(argv[0]);
Usage();
return 1;
}
nsCAutoString milestone;
nsresult rv = GetGREVersion(argv[0], &milestone, nsnull);
if (NS_FAILED(rv))
return 1;
printf("%s\n", milestone.get());
printf("%s\n", GRE_BUILD_ID);
return 0;
}
if (IsArg(argv[1], "install-app")) {
if (argc < 3 || argc > 5) {
Usage(argv[0]);
Usage();
return 1;
}
@ -403,13 +357,13 @@ int main(int argc, char* argv[])
if (!(appDataFile && *appDataFile)) {
if (argc < 2) {
Usage(argv[0]);
Usage();
return 1;
}
if (IsArg(argv[1], "app")) {
if (argc == 2) {
Usage(argv[0]);
Usage();
return 1;
}
argv[1] = argv[0];

Просмотреть файл

@ -13,7 +13,7 @@ Version=0.1
;
; This field specifies your application's build ID (timestamp). This field is
; required.
BuildID=20070625
BuildID=@BUILD_ID@
;
; This field specifies a compact copyright notice for your application. This
; field is optional.