summaryrefslogtreecommitdiff
path: root/indra/lib
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lib')
-rwxr-xr-xindra/lib/python/indra/util/llmanifest.py112
1 files changed, 99 insertions, 13 deletions
diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py
index 54049b5545..1d85aa2978 100755
--- a/indra/lib/python/indra/util/llmanifest.py
+++ b/indra/lib/python/indra/util/llmanifest.py
@@ -85,7 +85,8 @@ def get_default_platform(dummy):
}[sys.platform]
DEFAULT_SRCTREE = os.path.dirname(sys.argv[0])
-RELEASE_CHANNEL = 'Second Life Release'
+CHANNEL_VENDOR_BASE = 'Second Life'
+RELEASE_CHANNEL = CHANNEL_VENDOR_BASE + ' Release'
ARGUMENTS=[
dict(name='actions',
@@ -112,13 +113,14 @@ 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'),
+ dict(name='channel_suffix',
+ description="""Addition to the channel for packaging and channel value, but not application name (used internally)""",
+ default=None),
dict(name='installer_name',
description=""" The name of the file that the installer should be
packaged up into. Only used on Linux at the moment.""",
@@ -213,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()
@@ -224,15 +226,101 @@ def main():
for opt in args:
print "Option:", opt, "=", args[opt]
+ # pass in sourceid as an argument now instead of an environment variable
+ try:
+ args['sourceid'] = os.environ["sourceid"]
+ except KeyError:
+ args['sourceid'] = ""
+
+ # Build base package.
+ touch = args.get('touch')
+ if touch:
+ print 'Creating base package'
+ args['package_id'] = "" # base package has no package ID
wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
wm.do(*args['actions'])
-
+ # Store package file for later if making touched file.
+ base_package_file = ""
+ if touch:
+ print 'Created base package ', wm.package_file
+ base_package_file = "" + wm.package_file
+
+ # handle multiple packages if set
+ try:
+ additional_packages = os.environ["additional_packages"]
+ except KeyError:
+ additional_packages = ""
+ if additional_packages:
+ # Determine destination prefix / suffix for additional packages.
+ base_dest_postfix = args['dest']
+ base_dest_prefix = ""
+ base_dest_parts = args['dest'].split(os.sep)
+ if len(base_dest_parts) > 1:
+ base_dest_postfix = base_dest_parts[len(base_dest_parts) - 1]
+ base_dest_prefix = base_dest_parts[0]
+ i = 1
+ while i < len(base_dest_parts) - 1:
+ base_dest_prefix = base_dest_prefix + os.sep + base_dest_parts[i]
+ i = i + 1
+ # Determine touched prefix / suffix for additional packages.
+ base_touch_postfix = ""
+ base_touch_prefix = ""
+ if touch:
+ base_touch_postfix = touch
+ base_touch_parts = touch.split('/')
+ if "arwin" in args['platform']:
+ if len(base_touch_parts) > 1:
+ base_touch_postfix = base_touch_parts[len(base_touch_parts) - 1]
+ base_touch_prefix = base_touch_parts[0]
+ i = 1
+ while i < len(base_touch_parts) - 1:
+ base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
+ i = i + 1
+ else:
+ if len(base_touch_parts) > 2:
+ base_touch_postfix = base_touch_parts[len(base_touch_parts) - 2] + '/' + base_touch_parts[len(base_touch_parts) - 1]
+ base_touch_prefix = base_touch_parts[0]
+ i = 1
+ while i < len(base_touch_parts) - 2:
+ base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
+ i = i + 1
+ # Store base channel name.
+ base_channel_name = args['channel']
+ # Build each additional package.
+ package_id_list = additional_packages.split(" ")
+ args['channel'] = base_channel_name
+ for package_id in package_id_list:
+ try:
+ if package_id + "_viewer_channel_suffix" in os.environ:
+ args['channel_suffix'] = os.environ[package_id + "_viewer_channel_suffix"]
+ else:
+ args['channel_suffix'] = None
+ if package_id + "_sourceid" in os.environ:
+ args['sourceid'] = os.environ[package_id + "_sourceid"]
+ else:
+ args['sourceid'] = None
+ args['dest'] = base_dest_prefix + os.sep + package_id + os.sep + base_dest_postfix
+ except KeyError:
+ sys.stderr.write("Failed to create package for package_id: %s" % package_id)
+ sys.stderr.flush()
+ continue
+ if touch:
+ print 'Creating additional package for "', package_id, '" in ', args['dest']
+ wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
+ wm.do(*args['actions'])
+ if touch:
+ print 'Created additional package ', wm.package_file, ' for ', package_id
+ faketouch = base_touch_prefix + '/' + package_id + '/' + base_touch_postfix
+ fp = open(faketouch, 'w')
+ fp.write('set package_file=%s\n' % wm.package_file)
+ fp.close()
+
# Write out the package file in this format, so that it can easily be called
# and used in a .bat file - yeah, it sucks, but this is the simplest...
touch = args.get('touch')
if touch:
fp = open(touch, 'w')
- fp.write('set package_file=%s\n' % wm.package_file)
+ fp.write('set package_file=%s\n' % base_package_file)
fp.close()
print 'touched', touch
return 0
@@ -249,7 +337,7 @@ class LLManifest(object):
manifests = {}
def for_platform(self, platform, arch = None):
if arch:
- platform = platform + '_' + arch
+ platform = platform + '_' + arch + '_'
return self.manifests[platform.lower()]
for_platform = classmethod(for_platform)
@@ -266,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