summaryrefslogtreecommitdiff
path: root/indra/newview/viewer_manifest.py
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/viewer_manifest.py')
-rwxr-xr-xindra/newview/viewer_manifest.py59
1 files changed, 22 insertions, 37 deletions
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 80370be109..49dc732457 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -27,7 +27,6 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$
"""
import errno
-import glob
import json
import os
import os.path
@@ -920,11 +919,6 @@ class DarwinManifest(ViewerManifest):
with self.prefix(src="", dst="Contents"): # everything goes in Contents
# top-level Info.plist is as generated by CMake
Info_plist = self.dst_path_of("Info.plist")
- # except we twiddle these entries
- Info = plistlib.readPlist(Info_plist)
- Info["CFBundleGetInfoString"] = self.channel()
- Info["CFBundleShortVersionString"] = '.'.join(self.args['version'])
- plistlib.writePlist(Info, Info_plist)
# the one file in top-level MacOS directory is the trampoline to
# our nested launcher_app
@@ -1014,37 +1008,28 @@ open "%s" --args "$@"
here = self.get_dst_prefix()
relbase = os.path.realpath(os.path.dirname(Info_plist))
self.cmakedirs(here)
- # don't move the trampoline script we just made!
- executables = [f for f in os.listdir(toplevel_MacOS)
- if f != os.path.basename(trampoline)]
- if executables:
- # there are still executables in toplevel_MacOS
- for f in executables:
- fromwhere = os.path.join(toplevel_MacOS, f)
- towhere = self.dst_path_of(f)
- print "Moving %s => %s" % \
- (self.relpath(fromwhere, relbase),
- self.relpath(towhere, relbase))
- # now do it, only without relativizing paths
- os.rename(fromwhere, towhere)
-
- # Pick the biggest of the executables as the real viewer.
- # Make (size, filename) pairs; sort by size; pick the
- # last pair; take the filename entry from that.
- SecondLife = sorted((os.path.getsize(self.dst_path_of(f)), f)
- for f in executables)[-1][1]
- # now rename it to match the channel name
- exename = self.channel()
- exepath = self.dst_path_of(exename)
- print "{} => {}".format(SecondLife, exename)
- os.rename(self.dst_path_of(SecondLife), exepath)
-
- else:
- # executables already located 'here' -- pick the
- # biggest, as above
- exepath = sorted((os.path.getsize(f), f)
- for f in glob.glob(os.path.join(here, '*')))[-1][1]
- exename = os.path.basename(exepath)
+ for f in os.listdir(toplevel_MacOS):
+ if f == os.path.basename(trampoline):
+ # don't move the trampoline script we just made!
+ continue
+ fromwhere = os.path.join(toplevel_MacOS, f)
+ towhere = self.dst_path_of(f)
+ print "Moving %s => %s" % \
+ (self.relpath(fromwhere, relbase),
+ self.relpath(towhere, relbase))
+ # now do it, only without relativizing paths
+ os.rename(fromwhere, towhere)
+
+ # Pick the biggest of the executables as the real viewer.
+ # Make (basename, fullpath) pairs; for each pair,
+ # expand to (size, basename, fullpath) triples; sort
+ # by size; pick the last triple; take the basename and
+ # fullpath from that.
+ _, exename, exepath = \
+ sorted((os.path.getsize(path), name, path)
+ for name, path in
+ ((name, os.path.join(here, name))
+ for name in os.listdir(here)))[-1]
if ("package" in self.args['actions'] or
"unpacked" in self.args['actions']):