Changeset 3431


Ignore:
Timestamp:
Jun 11, 2018 5:53:52 PM (5 years ago)
Author:
toby
Message:

latest packaging/bootstrap mods

Location:
install
Files:
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • install/g2pkg/meta.yaml

    r3407 r3431  
    11package:
    22  name: gsas2pkg
    3   version: "1.0.4"  # remember to change in g2conda/construct.yaml to match this
     3  version: "1.0.6"  # remember to change in g2conda/construct.yaml to match this
    44
    55source:
  • install/g2pkg/src/bootstrap.py

    r3404 r3431  
    22# Installs GSAS-II from network using subversion and creates platform-specific shortcuts.
    33# works for Mac & Linux & Windows
    4 import os, stat, sys, platform, subprocess
     4import os, stat, sys, platform, subprocess, datetime
    55
    66g2home = 'https://subversion.xray.aps.anl.gov/pyGSAS/'
    77path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
    8 print('Running bootstrap from {}'.format(path2GSAS2))
     8now = str(datetime.datetime.now())
     9print('Running bootstrap from {} at {}'.format(path2GSAS2,now))
     10fp = open(os.path.join(path2GSAS2,'bootstrap.log'),'a')
     11fp.write('Running bootstrap from {} at {}\n'.format(path2GSAS2,now))
     12fp.close()
    913################################################################################
    1014################################################################################
     
    183187proxyinfo = os.path.join(path2GSAS2,"proxyinfo.txt")
    184188host = None
    185 port = '8080'
     189port = '80'
    186190if os.path.exists(proxyinfo):
    187191    fp = open(proxyinfo,'r')
     
    196200    getinput = input
    197201try:
    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:
    199223        ans = getinput("Enter the proxy address (type none to remove) ["+host+"]: ")
    200224        if ans.strip().lower() == "none": host = ans = ""
    201225    else:
    202226        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
    203231except EOFError:
    204     ans = ""
    205 if ans.strip() != "" or host:
     232    host = ""
     233    port = ""
     234if host:
    206235    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())
    209240    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')
    216243    fp.close()
    217244
Note: See TracChangeset for help on using the changeset viewer.