Changeset 1233 for gsas/linux
- Timestamp:
- May 21, 2013 5:21:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsas/linux/dist/bootstrap.py
r966 r1233 2 2 import os, stat, sys, platform, subprocess 3 3 home = 'https://subversion.xor.aps.anl.gov/EXPGUI/' 4 5 print sys.argv 4 proxycmds = [] 5 if os.path.exists("proxyinfo.txt"): 6 os.remove("proxyinfo.txt") 7 ans = raw_input("Enter the proxy address [none needed]: ") 8 if ans.strip() != "": 9 proxycmds.append('--config-option') 10 proxycmds.append('servers:global:http-proxy-host='+ans.strip()) 11 fp = open("proxyinfo.txt",'w') 12 fp.write(ans.strip()+'\n') 13 ans = raw_input("Enter the proxy port [8080]: ") 14 if ans.strip() == "": ans="8080" 15 proxycmds.append('--config-option') 16 proxycmds.append('servers:global:http-proxy-port='+ans.strip()) 17 fp.write(ans.strip()+'\n') 18 fp.close() 6 19 gsaspath = os.path.split(sys.argv[0])[0] 7 20 gsaspath = os.path.abspath(os.path.expanduser(gsaspath)) 8 9 21 print 'GSAS is being bootstrapped from repository to '+gsaspath 10 11 22 print 'Determining system type...', 12 if sys.platform.startswith('linux') and platform.processor().endswith('86'): 23 if sys.platform.startswith('linux'): 24 if platform.processor().find('86') <= -1: 25 ans = raw_input("Note, GSAS requires an Intel-compatible processor and 32-bit" 26 "libraries.\nAre you sure want to continue? [Yes]/no: ") 27 if ans.lower().find('no') > -1: sys.exit() 13 28 repos = 'linux' 29 print 'Linux, Intel-compatible' 14 30 elif sys.platform == "darwin" and platform.processor() == 'i386': 15 31 repos = 'osxi86' 32 print 'Mac OS X, Intel-compatible' 33 elif sys.platform == "darwin": 34 repos = 'osxppc' 35 print 'Mac OS X, PowerPC' 16 36 else: 17 37 raise Exception('Undefined system type') … … 20 40 print 'Checking for subversion...', 21 41 try: 22 #p = subprocess.call(['svn','status'],stdout=subprocess.PIPE)23 42 p = subprocess.Popen(['svn','help'],stdout=subprocess.PIPE) 24 43 except: … … 37 56 print 70*'*' 38 57 print msg + ' from ' + cmd[2] 58 cmd += proxycmds 39 59 for item in cmd: print item, 40 60 print "" 41 61 p = subprocess.call(cmd) 42 62 43 if sys.platform.startswith('linux') and platform.processor().endswith('86'):63 if sys.platform.startswith('linux'): 44 64 os.chmod(gsaspath + "/expgui/expgui", 45 65 stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH) 46 open(os.path.expanduser('~/Desktop/EXPGUI.desktop'),'w').write(''' 66 if os.path.exists(os.path.expanduser('~/Desktop/')): 67 open(os.path.expanduser('~/Desktop/EXPGUI.desktop'),'w').write(''' 47 68 [Desktop Entry] 48 69 Encoding=UTF-8 … … 54 75 Icon=%s/EXPGUI.png 55 76 ''' % (gsaspath,gsaspath)) 56 os.chmod(os.path.expanduser('~/Desktop/EXPGUI.desktop'),57 stat.S_IWUSR | stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH)58 open(os.path.expanduser('~/Desktop/GSAS.desktop'),'w').write('''77 os.chmod(os.path.expanduser('~/Desktop/EXPGUI.desktop'), 78 stat.S_IWUSR | stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH) 79 open(os.path.expanduser('~/Desktop/GSAS.desktop'),'w').write(''' 59 80 [Desktop Entry] 60 81 Encoding=UTF-8 … … 66 87 Icon=%s/GSAS.png 67 88 ''' % (gsaspath,gsaspath)) 68 os.chmod(os.path.expanduser('~/Desktop/GSAS.desktop'),69 stat.S_IWUSR | stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH)89 os.chmod(os.path.expanduser('~/Desktop/GSAS.desktop'), 90 stat.S_IWUSR | stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH)
Note: See TracChangeset
for help on using the changeset viewer.