From 79919ef9b6b9e9ede1580ae69231affee3f42ff8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Sun, 24 Nov 2013 13:18:12 -0500 Subject: move setting default grid to settings_install.xml so that it works on all platforms --- indra/lib/python/indra/util/llmanifest.py | 14 +++----- .../installers/windows/installer_template.nsi | 12 ++----- indra/newview/viewer_manifest.py | 40 ++++++---------------- 3 files changed, 18 insertions(+), 48 deletions(-) (limited to 'indra') diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index d9f877e07f..1d85aa2978 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -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 diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 8a6114f0d5..4742d7e178 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -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} diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index a657c4738c..9e8623c1f9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -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)}) -- cgit v1.2.3