Changeset 1240


Ignore:
Timestamp:
Dec 4, 2013 6:59:17 PM (7 years ago)
Author:
toby
Message:

updates for new subversion & repository switch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsas/linux/dist/bootstrap.py

    r1234 r1240  
    11#!/usr/bin/env python
    22import os, stat, sys, platform, subprocess
    3 home = 'https://subversion.xor.aps.anl.gov/EXPGUI/'
     3home = 'https://subversion.xray.aps.anl.gov/EXPGUI/'
    44proxycmds = []
    55if os.path.exists("proxyinfo.txt"):
    66    os.remove("proxyinfo.txt")
     7print(70*"=")
     8print(70*"=")
    79ans = raw_input("Enter the proxy address [none needed]: ")
    810if ans.strip() != "":
     
    4042print 'Checking for subversion...',
    4143try:
    42     #p = subprocess.call(['svn','status'],stdout=subprocess.PIPE)
    4344    p = subprocess.Popen(['svn','help','switch'],stdout=subprocess.PIPE)
    4445except:
    45     raise Exception('Subversion (svn) not found. Use "yum install svn" or "dpkg",...')
     46    if sys.platform.startswith('linux'):
     47        print('Use "yum install svn" or "dpkg",... to install svn/subversion')
     48    elif sys.platform == "darwin":
     49        print('See https://subversion.xray.aps.anl.gov/trac/EXPGUI/wiki/InstallOSX for info on installing svn/subversion')
     50    raise Exception('Subversion (svn) not found')
    4651res = p.stdout.read()
    4752if res.find('--ignore-ancestry') == -1:
     
    5257    print ' svn >=1.7 OK'
    5358
    54 cmds = (
     59if os.path.exists(os.path.join(gsaspath,'.svn')):
     60    p = subprocess.Popen(['svn','info',gsaspath],stdout=subprocess.PIPE)
     61    res = p.stdout.read()
     62else:
     63    res = ''
     64
     65cmds = [
    5566    (['svn', 'co', home+ 'gsas/all', gsaspath],'loading GSAS common'),
    5667    (['svn', 'switch', home+ 'trunk/', gsaspath+'/expgui'],'loading EXPGUI'),
    5768    (['svn', 'switch', home+ 'gsas/' + repos+ '/exe/', gsaspath+'/exe'],'loading GSAS programs'),
    5869    (['svn', 'switch', home+ 'gsas/' + repos+ '/pgl/', gsaspath+'/pgl'],'loading PGPLOT files'),
    59 )
     70]
     71
     72if res.find('.xor.aps.') != -1:
     73    cmds.insert(0,
     74               (['svn', 'switch', '--relocate',
     75                 'https://subversion.xor.aps.anl.gov/EXPGUI', home, gsaspath],
     76                'Switching EXPGUI repository to xray.aps')
     77               )
    6078
    6179for cmd,msg in cmds:
    6280    print 70*'*'
    63     print msg + ' from ' + cmd[2]
     81    print msg
     82    if proxycmds: cmd += proxycmds
     83    if svnopt and cmd[1] == 'switch': cmd += [svnopt]
    6484    for item in cmd: print item,
    6585    print ""
    66     if svnopt: cmd += [svnopt]
    6786    p = subprocess.call(cmd)
    6887
    69 if sys.platform.startswith('linux'):
     88if sys.platform.startswith('darwin'):
     89    appmaker = os.path.join(gsaspath,'expgui','makeMacApp.py')
     90    if os.path.exists(appmaker):
     91        execfile(appmaker)
     92    else:
     93        print("file "+str(appmaker)+" not found")
     94
     95elif sys.platform.startswith('linux'):
    7096    os.chmod(gsaspath + "/expgui/expgui",
    7197             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.