Skip to content
Snippets Groups Projects
Commit 109cd684 authored by Ryan Williams's avatar Ryan Williams
Browse files

Mac .dmgs generated by the manifest have upper-case grid names again.

Refactored a lot of the command-line options so that it's more self-documenting.  Now we have a --help option.

Created a separate action for creating unpackeds, which is not part of the default actions (yet).  This should speed up the packaging process.  In the process of doing this, I also made sure to enforce the constraint that no actions are performed on the files in the destination directory after the construct method ends.  To accomplish this I simply moved some strip method calls up into the construct method.

Lastly, I added our copyright notice to installer_template.nsi, and fixed a reference to a non-existant variable.  Hopefully this last won't cause spurious conflicts with Callum's work.

Reviewed by Richard.

Also, the tabs were a little screwed up in the python files, so I untabified and all is good.
parent b5342e23
No related branches found
No related tags found
No related merge requests found
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; secondlife setup.nsi ;;; @file viewer_manifest.py
;;; Copyright 2004-2006, Linden Research, Inc. ;;; @author James Cook, Don Kjer
;;; @brief NSIS script for creating a Windows installer.
;;; This file has variables expanded by viewer_manifest.py
;;; to produce the complete nsi script file.
;;; For info, see http://www.nullsoft.com/free/nsis/ ;;; For info, see http://www.nullsoft.com/free/nsis/
;;;
;;; NSIS 2.02 or higher required ;;; NSIS 2.02 or higher required
;;; Author: James Cook, Don Kjer ;;;
;;; Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
;;; $License$
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
...@@ -612,7 +616,7 @@ ShowUninstDetails show ...@@ -612,7 +616,7 @@ ShowUninstDetails show
Section Uninstall Section Uninstall
; Start with some default values. ; Start with some default values.
StrCpy $INSTFLAGS "${FARMFLAG}" StrCpy $INSTFLAGS "${INSTFLAGS}"
StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTPROG "${INSTNAME}"
StrCpy $INSTEXE "${INSTEXE}" StrCpy $INSTEXE "${INSTEXE}"
StrCpy $INSTSHORTCUT "${SHORTCUT}" StrCpy $INSTSHORTCUT "${SHORTCUT}"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
import re import re
import tarfile import tarfile
viewer_dir = os.path.dirname(__file__) viewer_dir = os.path.dirname(__file__)
# add llmanifest library to our path so you don't have to muck with PYTHONPATH # add llmanifest library to our path so we don't have to muck with PYTHONPATH
sys.path.append(os.path.join(viewer_dir, '../lib/python/indra')) sys.path.append(os.path.join(viewer_dir, '../lib/python/indra'))
from llmanifest import LLManifest, main, proper_windows_path, path_ancestors from llmanifest import LLManifest, main, proper_windows_path, path_ancestors
...@@ -74,7 +74,7 @@ def flags_list(self): ...@@ -74,7 +74,7 @@ def flags_list(self):
elif(self.args['grid'] == 'firstlook'): elif(self.args['grid'] == 'firstlook'):
return '-settings settings_firstlook.xml' return '-settings settings_firstlook.xml'
else: else:
return ("-settings settings_beta.xml --%(grid)s -helperuri http://preview-%(grid)s.secondlife.com/helpers/" % {'grid':self.args['grid']}) return ("-settings settings_beta.xml --%(grid)s -helperuri http://preview-%(grid)s.secondlife.com/helpers/" % {'grid':self.args['grid']})
def login_url(self): def login_url(self):
""" Convenience function that returns the appropriate login url for the grid""" """ Convenience function that returns the appropriate login url for the grid"""
...@@ -92,16 +92,6 @@ def replace_login_url(self): ...@@ -92,16 +92,6 @@ def replace_login_url(self):
# set the login page to point to a url appropriate for the type of client # set the login page to point to a url appropriate for the type of client
self.replace_in("skins/xui/en-us/panel_login.xml", searchdict={'http://secondlife.com/app/login/':self.login_url()}) self.replace_in("skins/xui/en-us/panel_login.xml", searchdict={'http://secondlife.com/app/login/':self.login_url()})
def create_unpacked(self):
unpacked_file_name = "unpacked_%(plat)s_%(vers)s.tar" % {
'plat':self.args['platform'],
'vers':'_'.join(self.args['version'])}
print "Creating unpacked file:", unpacked_file_name
# could add a gz here but that doubles the time it takes to do this step
tf = tarfile.open(self.src_path_of(unpacked_file_name), 'w:')
# add the entire installation package, at the very top level
tf.add(self.get_dst_prefix(), "")
tf.close()
class WindowsManifest(ViewerManifest): class WindowsManifest(ViewerManifest):
def final_exe(self): def final_exe(self):
...@@ -187,26 +177,25 @@ def wpath(path): ...@@ -187,26 +177,25 @@ def wpath(path):
result += 'File ' + pkg_file + '\n' result += 'File ' + pkg_file + '\n'
else: else:
result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n' result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n'
# at the end of a delete, just rmdir all the directories # at the end of a delete, just rmdir all the directories
if(not install): if(not install):
deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list] deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list]
# find all ancestors so that we don't skip any dirs that happened to have no non-dir children # find all ancestors so that we don't skip any dirs that happened to have no non-dir children
deleted_dirs = [] deleted_dirs = []
for d in deleted_file_dirs: for d in deleted_file_dirs:
deleted_dirs.extend(path_ancestors(d)) deleted_dirs.extend(path_ancestors(d))
# sort deepest hierarchy first # sort deepest hierarchy first
deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b)) deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
deleted_dirs.reverse() deleted_dirs.reverse()
prev = None prev = None
for d in deleted_dirs: for d in deleted_dirs:
if d != prev: # skip duplicates if d != prev: # skip duplicates
result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n' result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n'
prev = d prev = d
return result return result
def package_finish(self): def package_finish(self):
self.create_unpacked()
version_vars_template = """ version_vars_template = """
!define INSTEXE "%(final_exe)s" !define INSTEXE "%(final_exe)s"
!define VERSION "%(version_short)s" !define VERSION "%(version_short)s"
...@@ -227,7 +216,7 @@ def package_finish(self): ...@@ -227,7 +216,7 @@ def package_finish(self):
installer_file = "Second Life %(version_dashes)s (%(grid_caps)s) Setup.exe" installer_file = "Second Life %(version_dashes)s (%(grid_caps)s) Setup.exe"
grid_vars_template = """ grid_vars_template = """
OutFile "%(outfile)s" OutFile "%(outfile)s"
!define INSTFLAGS "%(flags)s" !define INSTFLAGS "%(flags)s"
!define INSTNAME "SecondLife%(grid_caps)s" !define INSTNAME "SecondLife%(grid_caps)s"
!define SHORTCUT "Second Life (%(grid_caps)s)" !define SHORTCUT "Second Life (%(grid_caps)s)"
!define URLNAME "secondlife%(grid)s" !define URLNAME "secondlife%(grid)s"
...@@ -255,7 +244,7 @@ def package_finish(self): ...@@ -255,7 +244,7 @@ def package_finish(self):
NSIS_path = 'C:\\Program Files\\NSIS\\makensis.exe' NSIS_path = 'C:\\Program Files\\NSIS\\makensis.exe'
self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile))
# self.remove(self.dst_path_of(tempfile)) self.remove(self.dst_path_of(tempfile))
self.created_path(installer_file) self.created_path(installer_file)
...@@ -268,9 +257,6 @@ def construct(self): ...@@ -268,9 +257,6 @@ def construct(self):
# Expand the tar file containing the assorted mozilla bits into # Expand the tar file containing the assorted mozilla bits into
# <bundle>/Contents/MacOS/ # <bundle>/Contents/MacOS/
self.contents_of_tar('mozilla-universal-darwin.tgz', 'MacOS') self.contents_of_tar('mozilla-universal-darwin.tgz', 'MacOS')
# self.run_command('tar -zx -C "%(macos)s" -f "%(tarfile)s"' %
# {'macos':self.ensure_dst_dir("MacOS"),
# 'tarfile':self.src_path_of("mozilla-universal-darwin.tgz")})
# replace the default theme with our custom theme (so scrollbars work). # replace the default theme with our custom theme (so scrollbars work).
if self.prefix(src="mozilla-theme", dst="MacOS/chrome"): if self.prefix(src="mozilla-theme", dst="MacOS/chrome"):
...@@ -305,21 +291,21 @@ def construct(self): ...@@ -305,21 +291,21 @@ def construct(self):
self.end_prefix("Resources") self.end_prefix("Resources")
self.end_prefix("Contents") self.end_prefix("Contents")
def package_finish(self):
# NOTE: the -S argument to strip causes it to keep enough info for # NOTE: the -S argument to strip causes it to keep enough info for
# annotated backtraces (i.e. function names in the crash log). 'strip' with no # annotated backtraces (i.e. function names in the crash log). 'strip' with no
# arguments yields a slightly smaller binary but makes crash logs mostly useless. # arguments yields a slightly smaller binary but makes crash logs mostly useless.
# This may be desirable for the final release. Or not. # This may be desirable for the final release. Or not.
self.run_command('strip -S "%(viewer_binary)s"' % if("package" in self.args['actions'] or
{ 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')}) "unpacked" in self.args['actions']):
self.run_command('strip -S "%(viewer_binary)s"' %
{ 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')})
self.create_unpacked()
def package_finish(self):
imagename="SecondLife_" + '_'.join(self.args['version']) imagename="SecondLife_" + '_'.join(self.args['version'])
if(self.args['grid'] != ''): if(self.args['grid'] != ''):
imagename = imagename + '_' + self.args['grid'] imagename = imagename + '_' + self.args['grid'].upper()
sparsename = imagename + ".sparseimage" sparsename = imagename + ".sparseimage"
finalname = imagename + ".dmg" finalname = imagename + ".dmg"
...@@ -367,6 +353,12 @@ def construct(self): ...@@ -367,6 +353,12 @@ def construct(self):
# set proper login url # set proper login url
self.replace_login_url() self.replace_login_url()
# stripping all the libs removes a few megabytes from the end-user package
for s,d in self.file_list:
if re.search("lib/lib.+\.so.*", d):
self.run_command('strip -S %s' % d)
def package_finish(self): def package_finish(self):
if(self.args.has_key('installer_name')): if(self.args.has_key('installer_name')):
installer_name = self.args['installer_name'] installer_name = self.args['installer_name']
...@@ -375,11 +367,6 @@ def package_finish(self): ...@@ -375,11 +367,6 @@ def package_finish(self):
if grid != '': if grid != '':
installer_name += "_" + grid.upper() installer_name += "_" + grid.upper()
# stripping all the libs removes a few megabytes from the end-user package
for s,d in self.file_list:
if re.search("lib/lib.+\.so.*", d):
self.run_command('strip -S %s' % d)
self.create_unpacked()
# temporarily move directory tree so that it has the right name in the tarfile # temporarily move directory tree so that it has the right name in the tarfile
self.run_command("mv %(dst)s %(inst)s" % {'dst':self.get_dst_prefix(),'inst':self.src_path_of(installer_name)}) self.run_command("mv %(dst)s %(inst)s" % {'dst':self.get_dst_prefix(),'inst':self.src_path_of(installer_name)})
# --numeric-owner hides the username of the builder for security etc. # --numeric-owner hides the username of the builder for security etc.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment