source: gsas/all/bootstrap.py @ 947

Last change on this file since 947 was 947, checked in by toby, 14 years ago

reduce to common, cleanup

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/usr/bin/env python
2import os, sys, platform, subprocess
3home = 'https://subversion.xor.aps.anl.gov/EXPGUI/'
4
5print sys.argv
6gsaspath = os.path.split(sys.argv[0])[0]
7gsaspath = os.path.abspath(os.path.expanduser(gsaspath))
8
9print 'GSAS is being bootstrapped from repository to '+gsaspath
10
11print 'Determining system type...',
12if sys.platform.startswith('linux') and platform.processor().endswith('86'):
13    repos = 'linux'
14elif sys.platform == "darwin" and platform.processor() == 'i386':
15    repos = 'osxi86'
16else:
17    raise Exception('Undefined system type')
18print 'OK'
19
20print 'Checking for subversion...',
21try: 
22    #p = subprocess.call(['svn','status'],stdout=subprocess.PIPE)
23    p = subprocess.Popen(['svn','status'],stdout=subprocess.PIPE)
24except:
25    raise Exception('Subversion (svn) not found')
26res = p.stdout.read()
27print 'OK'
28
29cmds = (
30    (['svn', 'switch', home+ 'trunk/', gsaspath+'/expgui'],'loading EXPGUI'),
31    (['svn', 'switch', home+ 'gsas/' + repos+ '/exe/', gsaspath+'/exe'],'loading GSAS programs'),
32    (['svn', 'switch', home+ 'gsas/' + repos+ '/pgplot/', gsaspath+'/pgplot'],'loading PGPLOT files'),
33)
34
35for cmd,msg in cmds: 
36    print 70*'*'
37    print msg + ' from ' + cmd[2]
38    p = subprocess.call(cmd)
39
40if sys.platform.startswith('linux') and platform.processor().endswith('86'):
41    open(os.path.expanduser('~/Desktop/EXPGUI.desktop'),'w').write('''
42[Desktop Entry]
43Encoding=UTF-8
44Version=1.0
45Type=Application
46Terminal=false
47Exec=/tmp/gsas/expgui/expgui
48Name=EXPGUI
49Icon=/usr/share/pixmaps/gnome-gmenu.png
50''')
Note: See TracBrowser for help on using the repository browser.