move setting default grid to settings_install.xml so that it works on all platforms

meow-7.2.2
Oz Linden 2013-11-24 13:18:12 -05:00
parent 6d6b0edfe2
commit 79919ef9b6
3 changed files with 18 additions and 48 deletions

View File

@ -113,10 +113,8 @@ ARGUMENTS=[
default="Release"),
dict(name='dest', description='Destination directory.', default=DEFAULT_SRCTREE),
dict(name='grid',
description="""Which grid the client will try to connect to. Even
though it's not strictly a grid, 'firstlook' is also an acceptable
value for this parameter.""",
default=""),
description="""Which grid the client will try to connect to.""",
default=None),
dict(name='channel',
description="""The channel to use for updates, packaging, settings name, etc.""",
default='CHANNEL UNSET'),
@ -217,9 +215,9 @@ def main():
print "Unable to read versionfile '%s'" % args['versionfile']
raise
# default and agni are default
if args['grid'] in ['default', 'agni']:
args['grid'] = ''
# unspecified, default, and agni are default
if args['grid'] in ['', 'default', 'agni']:
args['grid'] = None
if 'actions' in args:
args['actions'] = args['actions'].split()
@ -356,8 +354,6 @@ class LLManifest(object):
self.created_paths = []
self.package_name = "Unknown"
def default_grid(self):
return self.args.get('grid', None) == ''
def default_channel(self):
return self.args.get('channel', None) == RELEASE_CHANNEL

View File

@ -72,16 +72,8 @@ LangString LanguageCode ${LANG_RUSSIAN} "ru"
LangString LanguageCode ${LANG_TURKISH} "tr"
LangString LanguageCode ${LANG_TRADCHINESE} "zh"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py)
;; For example:
;; !define INSTFLAGS "%(flags)s"
;; !define INSTNAME "SecondLife%(grid_caps)s"
;; !define SHORTCUT "Second Life (%(grid_caps)s)"
;; !define URLNAME "secondlife%(grid)s"
;; !define UNINSTALL_SETTINGS 1
%%GRID_VARS%%
;; this placeholder is replaced by viewer_manifest.py
%%INST_VARS%%
Name ${INSTNAME}

View File

@ -112,6 +112,10 @@ class ViewerManifest(LLManifest):
Persist=1,
Type='String',
Value=''),
CmdLineGridChoice=dict(Comment='Default grid',
Persist=0,
Type='String',
Value=''),
CmdLineChannel=dict(Comment='Command line specified channel name',
Persist=0,
Type='String',
@ -123,11 +127,15 @@ class ViewerManifest(LLManifest):
print "Set sourceid in settings_install.xml to '%s'" % self.args['sourceid']
if 'channel_suffix' in self.args and self.args['channel_suffix']:
print "DEBUG CmdLineChannel channel_suffix '%s'" % self.args['channel_suffix']
settings_install['CmdLineChannel'] = settings_template['CmdLineChannel'].copy()
settings_install['CmdLineChannel']['Value'] = self.channel_with_pkg_suffix()
print "Set CmdLineChannel in settings_install.xml to '%s'" % self.channel_with_pkg_suffix()
if 'grid' in self.args and self.args['grid']:
settings_install['CmdLineGridChoice'] = settings_template['CmdLineGridChoice'].copy()
settings_install['CmdLineGridChoice']['Value'] = self.grid()
print "Set CmdLineGridChoice in settings_install.xml to '%s'" % self.grid()
# did we actually copy anything into settings_install dict?
if settings_install:
# put_in_file(src=) need not be an actual pathname; it
@ -264,31 +272,6 @@ class ViewerManifest(LLManifest):
def icon_path(self):
return "icons/" + self.channel_type()
def flags_list(self):
""" Convenience function that returns the command-line flags
for the grid"""
# The original role of this method seems to have been to build a
# grid-specific viewer: one that would, on launch, preselect a
# particular grid. (Apparently that dates back to when the protocol
# between viewer and simulator required them to be updated in
# lockstep, so that "the beta grid" required "a beta viewer.") But
# those viewer command-line switches no longer work without tweaking
# user_settings/grids.xml. In fact, going forward, it's unclear what
# use case that would address.
# This method also set a channel-specific (or grid-and-channel-
# specific) user_settings/settings_something.xml file. It has become
# clear that saving user settings in a channel-specific file causes
# more problems (confusion) than it solves, so we've discontinued that.
# In fact we now avoid forcing viewer command-line switches at all,
# instead introducing a settings_install.xml file. Command-line
# switches don't aggregate well; for instance the generated --channel
# switch actually prevented the user specifying --channel on the
# command line. Settings files have well-defined override semantics.
return None
def extract_names(self,src):
try:
contrib_file = open(src,'r')
@ -616,9 +599,8 @@ class Windows_i686_Manifest(ViewerManifest):
else:
substitution_strings['caption'] = self.app_name() + ' ${VERSION}'
grid_vars_template = """
inst_vars_template = """
OutFile "%(installer_file)s"
!define INSTFLAGS "%(flags)s"
!define INSTNAME "%(app_name_oneword)s"
!define SHORTCUT "%(app_name)s"
!define URLNAME "secondlife"
@ -631,7 +613,7 @@ class Windows_i686_Manifest(ViewerManifest):
self.replace_in("installers/windows/installer_template.nsi", tempfile, {
"%%VERSION%%":version_vars,
"%%SOURCE%%":self.get_src_prefix(),
"%%GRID_VARS%%":grid_vars_template % substitution_strings,
"%%INST_VARS%%":inst_vars_template % substitution_strings,
"%%INSTALL_FILES%%":self.nsi_file_commands(True),
"%%DELETE_FILES%%":self.nsi_file_commands(False)})