aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/scripts/install.py
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/install.py
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/install.py')
-rwxr-xr-xlinden/scripts/install.py50
1 files changed, 48 insertions, 2 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