зеркало из https://github.com/mozilla/pjs.git
Bug 488936 - Store the install locale in its own file. r=bsmedberg, r=ted.mielczarek
This commit is contained in:
Родитель
0eccf52e9b
Коммит
abd97a0d0f
|
@ -26,6 +26,7 @@ bin/defaults/profile/localstore.rdf
|
|||
bin/defaults/profile/prefs.js
|
||||
bin/defaults/profile/mimeTypes.rdf
|
||||
bin/defaults/profile/chrome/*
|
||||
bin/update.locale
|
||||
bin/updater.ini
|
||||
bin/dictionaries/*
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ bin\defaults\profile\prefs.js
|
|||
bin\defaults\profile\mimeTypes.rdf
|
||||
bin\defaults\profile\chrome\*
|
||||
bin\uninstall\helper.exe
|
||||
bin\update.locale
|
||||
bin\updater.ini
|
||||
bin\dictionaries\*
|
||||
|
||||
|
|
|
@ -346,15 +346,15 @@ installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
|
|||
ifdef MOZ_UPDATER
|
||||
libs:: $(addprefix $(LOCALE_SRCDIR)/,updater/updater.ini)
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
cat $< $(srcdir)/updater_append.ini $(srcdir)/../installer/windows/nsis/updater_append.ini | \
|
||||
cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
|
||||
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
|
||||
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" | \
|
||||
sed -e "s/%AB_CD%/$(AB_CD)/" > $(FINAL_TARGET)/updater.ini
|
||||
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
|
||||
$(FINAL_TARGET)/updater.ini
|
||||
else
|
||||
cat $< $(srcdir)/updater_append.ini | \
|
||||
cat $< \
|
||||
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
|
||||
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" | \
|
||||
sed -e "s/%AB_CD%/$(AB_CD)/" > $(FINAL_TARGET)/updater.ini
|
||||
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
|
||||
$(FINAL_TARGET)/updater.ini
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
; IMPORTANT: This file should always start with a newline in case a locale
|
||||
; provided updater.ini does not end with a newline.
|
||||
[Installation]
|
||||
Locale=%AB_CD%
|
|
@ -68,6 +68,12 @@ ifdef MOZ_PSM
|
|||
endif
|
||||
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$*
|
||||
|
||||
|
||||
ifdef MOZ_UPDATER
|
||||
libs:: update.locale
|
||||
cat $< | sed -e "s/%AB_CD%/$(AB_CD)/" > $(FINAL_TARGET)/update.locale
|
||||
endif
|
||||
|
||||
ifdef MOZ_CRASHREPORTER
|
||||
libs:: crashreporter.ini
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
%AB_CD%
|
|
@ -78,6 +78,7 @@ const URI_UPDATES_PROPERTIES = "chrome://mozapps/locale/update/updates.proper
|
|||
const URI_UPDATE_NS = "http://www.mozilla.org/2005/app-update";
|
||||
|
||||
const KEY_APPDIR = "XCurProcD";
|
||||
const KEY_GRED = "GreD";
|
||||
#ifdef XP_WIN
|
||||
const KEY_UPDROOT = "UpdRootD";
|
||||
const KEY_UAPPDATA = "UAppData";
|
||||
|
@ -92,7 +93,7 @@ const FILE_UPDATES_DB = "updates.xml";
|
|||
const FILE_UPDATE_ACTIVE = "active-update.xml";
|
||||
const FILE_PERMS_TEST = "update.test";
|
||||
const FILE_LAST_LOG = "last-update.log";
|
||||
const FILE_UPDATER_INI = "updater.ini";
|
||||
const FILE_UPDATE_LOCALE = "update.locale";
|
||||
|
||||
const MODE_RDONLY = 0x01;
|
||||
const MODE_WRONLY = 0x02;
|
||||
|
@ -518,19 +519,26 @@ function getPref(func, preference, defaultValue) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the locale specified by the 'Locale' key in the 'Installation' section
|
||||
* of updater.ini.
|
||||
* Gets the locale from the update.locale file for replacing %LOCALE% in the
|
||||
* update url. The update.locale file can be located in the application
|
||||
* directory or the GRE directory with preference given to it being located in
|
||||
* the application directory.
|
||||
*/
|
||||
function getLocale() {
|
||||
if (gLocale)
|
||||
return gLocale;
|
||||
|
||||
var updaterIni = getFile(KEY_APPDIR, [FILE_UPDATER_INI]);
|
||||
var iniParser = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
|
||||
getService(Ci.nsIINIParserFactory).
|
||||
createINIParser(updaterIni);
|
||||
gLocale = iniParser.getString("Installation", "Locale");
|
||||
LOG("General", "getLocale - getting locale from file: " + updaterIni.path +
|
||||
var localeFile = getFile(KEY_APPDIR, [FILE_UPDATE_LOCALE]);
|
||||
if (!localeFile.exists())
|
||||
localeFile = getFile(KEY_GRED, [FILE_UPDATE_LOCALE]);
|
||||
|
||||
if (!localeFile.exists())
|
||||
throw Components.Exception(FILE_UPDATE_LOCALE + " file doesn't exist in " +
|
||||
"either the " + KEY_APPDIR + " or " + KEY_GRED +
|
||||
" directories", Cr.NS_ERROR_FILE_NOT_FOUND);
|
||||
|
||||
gLocale = readStringFromFile(localeFile);
|
||||
LOG("General", "getLocale - getting locale from file: " + localeFile.path +
|
||||
", locale: " + gLocale);
|
||||
return gLocale;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ function check_test_pt4() {
|
|||
}
|
||||
|
||||
// url constructed with %LOCALE%
|
||||
// Bug 488936 added the locale to the updater.locale file
|
||||
// Bug 488936 added the update.locale file that stores the update locale
|
||||
function run_test_pt5() {
|
||||
gCheckFunc = check_test_pt5;
|
||||
var url = URL_PREFIX + "%LOCALE%/";
|
||||
|
|
Загрузка…
Ссылка в новой задаче