source: gsas/linux/dist/bootstrap.py @ 966

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

add missing dist files

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/usr/bin/env python
2import os, stat, 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','help'],stdout=subprocess.PIPE)
24except:
25    raise Exception('Subversion (svn) not found')
26res = p.stdout.read()
27print 'OK'
28
29cmds = (
30    (['svn', 'co', home+ 'gsas/all', gsaspath],'loading GSAS common'),
31    (['svn', 'switch', home+ 'trunk/', gsaspath+'/expgui'],'loading EXPGUI'),
32    (['svn', 'switch', home+ 'gsas/' + repos+ '/exe/', gsaspath+'/exe'],'loading GSAS programs'),
33    (['svn', 'switch', home+ 'gsas/' + repos+ '/pgl/', gsaspath+'/pgl'],'loading PGPLOT files'),
34)
35
36for cmd,msg in cmds: 
37    print 70*'*'
38    print msg + ' from ' + cmd[2]
39    for item in cmd: print item,
40    print ""
41    p = subprocess.call(cmd)
42
43if sys.platform.startswith('linux') and platform.processor().endswith('86'):
44    os.chmod(gsaspath + "/expgui/expgui", 
45             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('''
47[Desktop Entry]
48Encoding=UTF-8
49Version=1.0
50Type=Application
51Terminal=false
52Exec=%s/expgui/expgui
53Name=EXPGUI
54Icon=%s/EXPGUI.png
55''' % (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('''
59[Desktop Entry]
60Encoding=UTF-8
61Version=1.0
62Type=Application
63Terminal=true
64Exec=%s/GSAS
65Name=GSAS
66Icon=%s/GSAS.png
67''' % (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) 
Note: See TracBrowser for help on using the repository browser.