aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/scripts
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-01 17:39:58 -0600
committerJacek Antonelli2008-12-01 17:40:06 -0600
commit7abecb48babe6a6f09bf6692ba55076546cfced9 (patch)
tree8d18a88513fb97adf32c10aae78f4be1984942db /linden/scripts
parentSecond Life viewer sources 1.21.6 (diff)
downloadmeta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz
Second Life viewer sources 1.22.0-RC
Diffstat (limited to 'linden/scripts')
-rwxr-xr-xlinden/scripts/install.py50
-rwxr-xr-xlinden/scripts/template_verifier.py32
2 files changed, 75 insertions, 7 deletions
diff --git a/linden/scripts/install.py b/linden/scripts/install.py
index 0cc2fad..3e8f9bb 100755
--- a/linden/scripts/install.py
+++ b/linden/scripts/install.py
@@ -37,6 +37,7 @@ import copy
37import md5 37import md5
38import optparse 38import optparse
39import os 39import os
40import platform
40import pprint 41import pprint
41import shutil 42import shutil
42import sys 43import 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,23 @@ 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 this_platform = 'linux32'
762 return this_platform
734 763
735def _getuser(): 764def _getuser():
736 "Get the user" 765 "Get the user"
@@ -971,6 +1000,12 @@ Ignored if --add-installable or --add-installable-package is not specified.""")
971 dest='detail_installable', 1000 dest='detail_installable',
972 help="Get detailed information on specified installable and exit.") 1001 help="Get detailed information on specified installable and exit.")
973 parser.add_option( 1002 parser.add_option(
1003 '--detail-installed',
1004 type='string',
1005 default=None,
1006 dest='detail_installed',
1007 help="Get list of files for specified installed installable and exit.")
1008 parser.add_option(
974 '--uninstall', 1009 '--uninstall',
975 action='store_true', 1010 action='store_true',
976 default=False, 1011 default=False,
@@ -1012,6 +1047,17 @@ def main():
1012 print "Installable '"+options.detail_installable+"' not found in", 1047 print "Installable '"+options.detail_installable+"' not found in",
1013 print "install file." 1048 print "install file."
1014 return 0 1049 return 0
1050 if options.detail_installed:
1051 try:
1052 detail = installer.detail_installed(options.detail_installed)
1053 #print "Detail on installed",options.detail_installed+":"
1054 for line in detail:
1055 print line
1056 except:
1057 raise
1058 print "Installable '"+options.detail_installed+"' not found in ",
1059 print "install file."
1060 return 0
1015 if options.list_licenses: 1061 if options.list_licenses:
1016 print "license list:", installer.list_licenses() 1062 print "license list:", installer.list_licenses()
1017 return 0 1063 return 0
diff --git a/linden/scripts/template_verifier.py b/linden/scripts/template_verifier.py
index f1f3953..d451cbf 100755
--- a/linden/scripts/template_verifier.py
+++ b/linden/scripts/template_verifier.py
@@ -38,13 +38,35 @@ If [FILE] [FILE] is specified, two local files will be checked against
38each other. 38each other.
39""" 39"""
40 40
41from os.path import realpath, dirname, join, exists 41import sys
42setup_path = join(dirname(realpath(__file__)), "setup-path.py") 42import os.path
43if 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
50root = os.path.abspath(__file__)
51# always insert the directory of the script in the search path
52dir = os.path.dirname(root)
53if dir not in sys.path:
54 sys.path.insert(0, dir)
55
56# Now go look for indra/lib/python in the parent dies
57while 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
64else:
65 print >>sys.stderr, "This script is not inside a valid installation."
66 sys.exit(1)
67
45import optparse 68import optparse
46import os 69import os
47import sys
48import urllib 70import urllib
49 71
50from indra.ipc import compatibility 72from indra.ipc import compatibility