diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/scripts/install.py | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/scripts/install.py')
-rwxr-xr-x | linden/scripts/install.py | 75 |
1 files changed, 47 insertions, 28 deletions
diff --git a/linden/scripts/install.py b/linden/scripts/install.py index f886a6e..5069918 100755 --- a/linden/scripts/install.py +++ b/linden/scripts/install.py | |||
@@ -33,6 +33,36 @@ THE SOFTWARE. | |||
33 | $/LicenseInfo$ | 33 | $/LicenseInfo$ |
34 | """ | 34 | """ |
35 | 35 | ||
36 | import sys | ||
37 | import os.path | ||
38 | |||
39 | # Look for indra/lib/python in all possible parent directories ... | ||
40 | # This is an improvement over the setup-path.py method used previously: | ||
41 | # * the script may blocated anywhere inside the source tree | ||
42 | # * it doesn't depend on the current directory | ||
43 | # * it doesn't depend on another file being present. | ||
44 | |||
45 | def add_indra_lib_path(): | ||
46 | root = os.path.realpath(__file__) | ||
47 | # always insert the directory of the script in the search path | ||
48 | dir = os.path.dirname(root) | ||
49 | if dir not in sys.path: | ||
50 | sys.path.insert(0, dir) | ||
51 | |||
52 | # Now go look for indra/lib/python in the parent dies | ||
53 | while root != os.path.sep: | ||
54 | root = os.path.dirname(root) | ||
55 | dir = os.path.join(root, 'indra', 'lib', 'python') | ||
56 | if os.path.isdir(dir): | ||
57 | if dir not in sys.path: | ||
58 | sys.path.insert(0, dir) | ||
59 | return root | ||
60 | else: | ||
61 | print >>sys.stderr, "This script is not inside a valid installation." | ||
62 | sys.exit(1) | ||
63 | |||
64 | base_dir = add_indra_lib_path() | ||
65 | |||
36 | import copy | 66 | import copy |
37 | import md5 | 67 | import md5 |
38 | import optparse | 68 | import optparse |
@@ -40,7 +70,6 @@ import os | |||
40 | import platform | 70 | import platform |
41 | import pprint | 71 | import pprint |
42 | import shutil | 72 | import shutil |
43 | import sys | ||
44 | import tarfile | 73 | import tarfile |
45 | import tempfile | 74 | import tempfile |
46 | import urllib2 | 75 | import urllib2 |
@@ -48,20 +77,21 @@ import urlparse | |||
48 | 77 | ||
49 | from sets import Set as set, ImmutableSet as frozenset | 78 | from sets import Set as set, ImmutableSet as frozenset |
50 | 79 | ||
51 | # Locate -our- python library relative to our install location. | ||
52 | from os.path import realpath, dirname, join | ||
53 | |||
54 | # Walk back to checkout base directory | ||
55 | base_dir = dirname(dirname(realpath(__file__))) | ||
56 | # Walk in to libraries directory | ||
57 | lib_dir = join(join(join(base_dir, 'indra'), 'lib'), 'python') | ||
58 | |||
59 | if lib_dir not in sys.path: | ||
60 | sys.path.insert(0, lib_dir) | ||
61 | |||
62 | from indra.base import llsd | 80 | from indra.base import llsd |
63 | from indra.util import helpformatter | 81 | from indra.util import helpformatter |
64 | 82 | ||
83 | # *HACK: Necessary for python 2.3. Consider removing this code wart | ||
84 | # after etch has deployed everywhere. 2008-12-23 Phoenix | ||
85 | try: | ||
86 | sorted = sorted | ||
87 | except NameError: | ||
88 | def sorted(in_list): | ||
89 | "Return a list which is a sorted copy of in_list." | ||
90 | # Copy the source to be more functional and side-effect free. | ||
91 | out_list = copy.copy(in_list) | ||
92 | out_list.sort() | ||
93 | return out_list | ||
94 | |||
65 | class InstallFile(object): | 95 | class InstallFile(object): |
66 | "This is just a handy way to throw around details on a file in memory." | 96 | "This is just a handy way to throw around details on a file in memory." |
67 | def __init__(self, pkgname, url, md5sum, cache_dir, platform_path): | 97 | def __init__(self, pkgname, url, md5sum, cache_dir, platform_path): |
@@ -291,7 +321,7 @@ class Installer(object): | |||
291 | 321 | ||
292 | def list_installables(self): | 322 | def list_installables(self): |
293 | "Return a list of all known installables." | 323 | "Return a list of all known installables." |
294 | return self._installables.keys() | 324 | return sorted(self._installables.keys()) |
295 | 325 | ||
296 | def detail_installable(self, name): | 326 | def detail_installable(self, name): |
297 | "Return a installable definition detail" | 327 | "Return a installable definition detail" |
@@ -299,7 +329,7 @@ class Installer(object): | |||
299 | 329 | ||
300 | def list_licenses(self): | 330 | def list_licenses(self): |
301 | "Return a list of all known licenses." | 331 | "Return a list of all known licenses." |
302 | return self._licenses.keys() | 332 | return sorted(self._licenses.keys()) |
303 | 333 | ||
304 | def detail_license(self, name): | 334 | def detail_license(self, name): |
305 | "Return a license definition detail" | 335 | "Return a license definition detail" |
@@ -307,7 +337,7 @@ class Installer(object): | |||
307 | 337 | ||
308 | def list_installed(self): | 338 | def list_installed(self): |
309 | "Return a list of installed packages." | 339 | "Return a list of installed packages." |
310 | return self._installed.keys() | 340 | return sorted(self._installed.keys()) |
311 | 341 | ||
312 | def detail_installed(self, name): | 342 | def detail_installed(self, name): |
313 | "Return file list for specific installed package." | 343 | "Return file list for specific installed package." |
@@ -750,17 +780,6 @@ def _get_platform(): | |||
750 | # os/arch/compiler/compiler_version then we can replace the | 780 | # os/arch/compiler/compiler_version then we can replace the |
751 | # 'linux64' platform with 'linux/x86_64/gcc/4.1' | 781 | # 'linux64' platform with 'linux/x86_64/gcc/4.1' |
752 | this_platform = 'linux64' | 782 | this_platform = 'linux64' |
753 | else: | ||
754 | gcc_version = os.popen("g++ -dumpversion", 'r').read()[:-3] | ||
755 | if gcc_version == '4.1': | ||
756 | # the 'linux32' platform is a HACK until we can figure | ||
757 | # out how to make the install.py script accept a platform of | ||
758 | # the form os/arch/compiler/compiler_version for the download | ||
759 | # and extract stage | ||
760 | #this_platform = 'linux/i686/gcc/4.1' | ||
761 | # NOTE: disabled linux32 as it hasn't been tested well | ||
762 | #this_platform = 'linux32' | ||
763 | this_platform = this_platform | ||
764 | return this_platform | 783 | return this_platform |
765 | 784 | ||
766 | def _getuser(): | 785 | def _getuser(): |
@@ -832,13 +851,13 @@ darwin/universal/gcc/4.0 | |||
832 | parser.add_option( | 851 | parser.add_option( |
833 | '--install-manifest', | 852 | '--install-manifest', |
834 | type='string', | 853 | type='string', |
835 | default=join(base_dir, 'install.xml'), | 854 | default=os.path.join(base_dir, 'install.xml'), |
836 | dest='install_filename', | 855 | dest='install_filename', |
837 | help='The file used to describe what should be installed.') | 856 | help='The file used to describe what should be installed.') |
838 | parser.add_option( | 857 | parser.add_option( |
839 | '--installed-manifest', | 858 | '--installed-manifest', |
840 | type='string', | 859 | type='string', |
841 | default=join(base_dir, 'installed.xml'), | 860 | default=os.path.join(base_dir, 'installed.xml'), |
842 | dest='installed_filename', | 861 | dest='installed_filename', |
843 | help='The file used to record what is installed.') | 862 | help='The file used to record what is installed.') |
844 | parser.add_option( | 863 | parser.add_option( |