diff options
Diffstat (limited to 'linden/scripts')
-rwxr-xr-x | linden/scripts/install.py | 54 | ||||
-rwxr-xr-x | linden/scripts/setup-path.py | 2 | ||||
-rwxr-xr-x | linden/scripts/template_verifier.py | 34 |
3 files changed, 80 insertions, 10 deletions
diff --git a/linden/scripts/install.py b/linden/scripts/install.py index 0cc2fad..f886a6e 100755 --- a/linden/scripts/install.py +++ b/linden/scripts/install.py | |||
@@ -11,7 +11,7 @@ https://wiki.lindenlab.com/wiki/User:Phoenix/Library_Installation | |||
11 | 11 | ||
12 | $LicenseInfo:firstyear=2007&license=mit$ | 12 | $LicenseInfo:firstyear=2007&license=mit$ |
13 | 13 | ||
14 | Copyright (c) 2007-2008, Linden Research, Inc. | 14 | Copyright (c) 2007-2009, Linden Research, Inc. |
15 | 15 | ||
16 | Permission is hereby granted, free of charge, to any person obtaining a copy | 16 | Permission is hereby granted, free of charge, to any person obtaining a copy |
17 | of this software and associated documentation files (the "Software"), to deal | 17 | of this software and associated documentation files (the "Software"), to deal |
@@ -37,6 +37,7 @@ import copy | |||
37 | import md5 | 37 | import md5 |
38 | import optparse | 38 | import optparse |
39 | import os | 39 | import os |
40 | import platform | ||
40 | import pprint | 41 | import pprint |
41 | import shutil | 42 | import shutil |
42 | import sys | 43 | import sys |
@@ -308,6 +309,13 @@ class Installer(object): | |||
308 | "Return a list of installed packages." | 309 | "Return a list of installed packages." |
309 | return self._installed.keys() | 310 | return self._installed.keys() |
310 | 311 | ||
312 | def detail_installed(self, name): | ||
313 | "Return file list for specific installed package." | ||
314 | filelist = [] | ||
315 | for url in self._installed[name]._installed.keys(): | ||
316 | filelist.extend(self._installed[name].files_in(url)) | ||
317 | return filelist | ||
318 | |||
311 | def _update_field(self, description, field, value, multiline=False): | 319 | def _update_field(self, description, field, value, multiline=False): |
312 | """Given a block and a field name, add or update it. | 320 | """Given a block and a field name, add or update it. |
313 | @param description a dict containing all the details of a description. | 321 | @param description a dict containing all the details of a description. |
@@ -458,7 +466,12 @@ windows/i686/vs/2003 -- specify a windows visual studio 2003 package""" | |||
458 | if not self._dryrun: | 466 | if not self._dryrun: |
459 | if os.path.exists(filename): | 467 | if os.path.exists(filename): |
460 | remove_dir_set.add(os.path.dirname(filename)) | 468 | remove_dir_set.add(os.path.dirname(filename)) |
461 | os.remove(filename) | 469 | try: |
470 | os.remove(filename) | ||
471 | except OSError: | ||
472 | # This is just for cleanup, so we don't care | ||
473 | # about normal failures. | ||
474 | pass | ||
462 | for dirname in remove_dir_set: | 475 | for dirname in remove_dir_set: |
463 | try: | 476 | try: |
464 | os.removedirs(dirname) | 477 | os.removedirs(dirname) |
@@ -730,7 +743,25 @@ def _get_platform(): | |||
730 | 'cygwin' : 'windows', | 743 | 'cygwin' : 'windows', |
731 | 'solaris' : 'solaris' | 744 | 'solaris' : 'solaris' |
732 | } | 745 | } |
733 | return platform_map[sys.platform] | 746 | this_platform = platform_map[sys.platform] |
747 | if this_platform == 'linux': | ||
748 | if platform.architecture()[0] == '64bit': | ||
749 | # TODO -- someday when install.py accepts a platform of the form | ||
750 | # os/arch/compiler/compiler_version then we can replace the | ||
751 | # 'linux64' platform with 'linux/x86_64/gcc/4.1' | ||
752 | 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 | ||
734 | 765 | ||
735 | def _getuser(): | 766 | def _getuser(): |
736 | "Get the user" | 767 | "Get the user" |
@@ -971,6 +1002,12 @@ Ignored if --add-installable or --add-installable-package is not specified.""") | |||
971 | dest='detail_installable', | 1002 | dest='detail_installable', |
972 | help="Get detailed information on specified installable and exit.") | 1003 | help="Get detailed information on specified installable and exit.") |
973 | parser.add_option( | 1004 | parser.add_option( |
1005 | '--detail-installed', | ||
1006 | type='string', | ||
1007 | default=None, | ||
1008 | dest='detail_installed', | ||
1009 | help="Get list of files for specified installed installable and exit.") | ||
1010 | parser.add_option( | ||
974 | '--uninstall', | 1011 | '--uninstall', |
975 | action='store_true', | 1012 | action='store_true', |
976 | default=False, | 1013 | default=False, |
@@ -1012,6 +1049,17 @@ def main(): | |||
1012 | print "Installable '"+options.detail_installable+"' not found in", | 1049 | print "Installable '"+options.detail_installable+"' not found in", |
1013 | print "install file." | 1050 | print "install file." |
1014 | return 0 | 1051 | return 0 |
1052 | if options.detail_installed: | ||
1053 | try: | ||
1054 | detail = installer.detail_installed(options.detail_installed) | ||
1055 | #print "Detail on installed",options.detail_installed+":" | ||
1056 | for line in detail: | ||
1057 | print line | ||
1058 | except: | ||
1059 | raise | ||
1060 | print "Installable '"+options.detail_installed+"' not found in ", | ||
1061 | print "install file." | ||
1062 | return 0 | ||
1015 | if options.list_licenses: | 1063 | if options.list_licenses: |
1016 | print "license list:", installer.list_licenses() | 1064 | print "license list:", installer.list_licenses() |
1017 | return 0 | 1065 | return 0 |
diff --git a/linden/scripts/setup-path.py b/linden/scripts/setup-path.py index 9403dc8..7a73dad 100755 --- a/linden/scripts/setup-path.py +++ b/linden/scripts/setup-path.py | |||
@@ -6,7 +6,7 @@ to screw with PYTHONPATH or symbolic links. | |||
6 | 6 | ||
7 | $LicenseInfo:firstyear=2007&license=viewergpl$ | 7 | $LicenseInfo:firstyear=2007&license=viewergpl$ |
8 | 8 | ||
9 | Copyright (c) 2007-2008, Linden Research, Inc. | 9 | Copyright (c) 2007-2009, Linden Research, Inc. |
10 | 10 | ||
11 | Second Life Viewer Source Code | 11 | Second Life Viewer Source Code |
12 | The source code in this file ("Source Code") is provided by Linden Lab | 12 | The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/scripts/template_verifier.py b/linden/scripts/template_verifier.py index f1f3953..de9a444 100755 --- a/linden/scripts/template_verifier.py +++ b/linden/scripts/template_verifier.py | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | $LicenseInfo:firstyear=2007&license=viewergpl$ |
7 | 7 | ||
8 | Copyright (c) 2007-2008, Linden Research, Inc. | 8 | Copyright (c) 2007-2009, Linden Research, Inc. |
9 | 9 | ||
10 | Second Life Viewer Source Code | 10 | Second Life Viewer Source Code |
11 | The source code in this file ("Source Code") is provided by Linden Lab | 11 | The source code in this file ("Source Code") is provided by Linden Lab |
@@ -38,13 +38,35 @@ If [FILE] [FILE] is specified, two local files will be checked against | |||
38 | each other. | 38 | each other. |
39 | """ | 39 | """ |
40 | 40 | ||
41 | from os.path import realpath, dirname, join, exists | 41 | import sys |
42 | setup_path = join(dirname(realpath(__file__)), "setup-path.py") | 42 | import os.path |
43 | if exists(setup_path): | 43 | |
44 | execfile(setup_path) | 44 | # Look for indra/lib/python in all possible parent directories ... |
45 | # This is an improvement over the setup-path.py method used previously: | ||
46 | # * the script may blocated anywhere inside the source tree | ||
47 | # * it doesn't depend on the current directory | ||
48 | # * it doesn't depend on another file being present. | ||
49 | |||
50 | root = os.path.abspath(__file__) | ||
51 | # always insert the directory of the script in the search path | ||
52 | dir = os.path.dirname(root) | ||
53 | if dir not in sys.path: | ||
54 | sys.path.insert(0, dir) | ||
55 | |||
56 | # Now go look for indra/lib/python in the parent dies | ||
57 | while root != os.path.sep: | ||
58 | root = os.path.dirname(root) | ||
59 | dir = os.path.join(root, 'indra', 'lib', 'python') | ||
60 | if os.path.isdir(dir): | ||
61 | if dir not in sys.path: | ||
62 | sys.path.insert(0, dir) | ||
63 | break | ||
64 | else: | ||
65 | print >>sys.stderr, "This script is not inside a valid installation." | ||
66 | sys.exit(1) | ||
67 | |||
45 | import optparse | 68 | import optparse |
46 | import os | 69 | import os |
47 | import sys | ||
48 | import urllib | 70 | import urllib |
49 | 71 | ||
50 | from indra.ipc import compatibility | 72 | from indra.ipc import compatibility |