Changeset 3431
- Timestamp:
- Jun 11, 2018 5:53:52 PM (5 years ago)
- Location:
- install
- Files:
-
- 4 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
install/g2pkg/meta.yaml
r3407 r3431 1 1 package: 2 2 name: gsas2pkg 3 version: "1.0. 4" # remember to change in g2conda/construct.yaml to match this3 version: "1.0.6" # remember to change in g2conda/construct.yaml to match this 4 4 5 5 source: -
install/g2pkg/src/bootstrap.py
r3404 r3431 2 2 # Installs GSAS-II from network using subversion and creates platform-specific shortcuts. 3 3 # works for Mac & Linux & Windows 4 import os, stat, sys, platform, subprocess 4 import os, stat, sys, platform, subprocess, datetime 5 5 6 6 g2home = 'https://subversion.xray.aps.anl.gov/pyGSAS/' 7 7 path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) 8 print('Running bootstrap from {}'.format(path2GSAS2)) 8 now = str(datetime.datetime.now()) 9 print('Running bootstrap from {} at {}'.format(path2GSAS2,now)) 10 fp = open(os.path.join(path2GSAS2,'bootstrap.log'),'a') 11 fp.write('Running bootstrap from {} at {}\n'.format(path2GSAS2,now)) 12 fp.close() 9 13 ################################################################################ 10 14 ################################################################################ … … 183 187 proxyinfo = os.path.join(path2GSAS2,"proxyinfo.txt") 184 188 host = None 185 port = '80 80'189 port = '80' 186 190 if os.path.exists(proxyinfo): 187 191 fp = open(proxyinfo,'r') … … 196 200 getinput = input 197 201 try: 198 if host: 202 key = None 203 for i in os.environ.keys(): 204 if 'https_proxy' == i.lower(): 205 key = i 206 break 207 else: 208 for i in os.environ.keys(): 209 if 'http_proxy' == i.lower(): 210 key = i 211 break 212 if key: 213 val = os.environ[key].strip() 214 if val[-1] == '/': 215 val = val[:-1] 216 if len(val.split(':')) > 2: 217 host = ':'.join(val.split(':')[:-1]) 218 port = val.split(':')[-1] 219 else: 220 host = ':'.join(val.split(':')[:-1]) 221 port = val.split(':')[-1] 222 elif host: 199 223 ans = getinput("Enter the proxy address (type none to remove) ["+host+"]: ") 200 224 if ans.strip().lower() == "none": host = ans = "" 201 225 else: 202 226 ans = getinput("Enter your proxy address [none needed]: ") 227 if ans.strip() != "" or host: 228 ans = getinput("Enter the proxy port ["+port+"]: ") 229 if ans.strip() == "": ans=port 230 port = ans 203 231 except EOFError: 204 ans = "" 205 if ans.strip() != "" or host: 232 host = "" 233 port = "" 234 if host: 206 235 proxycmds.append('--config-option') 207 if ans.strip() == "": ans=host 208 proxycmds.append('servers:global:http-proxy-host='+ans.strip()) 236 proxycmds.append('servers:global:http-proxy-host='+host.strip()) 237 if port: 238 proxycmds.append('--config-option') 239 proxycmds.append('servers:global:http-proxy-port='+port.strip()) 209 240 fp = open(proxyinfo,'w') 210 fp.write(ans.strip()+'\n') 211 ans = getinput("Enter the proxy port ["+port+"]: ") 212 if ans.strip() == "": ans=port 213 proxycmds.append('--config-option') 214 proxycmds.append('servers:global:http-proxy-port='+ans.strip()) 215 fp.write(ans.strip()+'\n') 241 fp.write(host.strip()+'\n') 242 fp.write(port.strip()+'\n') 216 243 fp.close() 217 244
Note: See TracChangeset
for help on using the changeset viewer.