source: anuga_core/source/pypar-numeric/release @ 7695

Last change on this file since 7695 was 5779, checked in by steve, 16 years ago

Added the old version of pypar which works with Numeric. Necessary for parallel code until we move anuga to numpy (and then we can use pypar as distribute via sourceforge).

File size: 3.8 KB
Line 
1#!/usr/bin/env python
2#
3# Release version as tagged by
4#   cvs tag release-x-y-z
5
6import sys, os, string, os.path, time
7
8import pypar
9try:
10  date = pypar.__date__
11except:
12  print 'WARNING: Could not obtain __date__ from pypar.py'
13  date = time.ctime()
14
15rev = pypar.__version__
16 
17
18package = 'pypar'
19destination = os.path.expanduser('~/public_html/pypar')
20
21# FIXME: temporarily commented out. Need to rewrite for Subversion.
22#
23# Get tag to release
24#
25#if len(sys.argv) > 1:
26#  release = sys.argv[1]
27#else:
28#  from popen2 import popen2
29#  output, input = popen2('cvs log 2>/dev/null')
30#  input.close()
31#  lines = output.readlines()
32#
33#  found = 0 
34#  for line in lines:
35#    #print line,
36#   
37#    if found:
38#      tag, revision = line.split(':')
39#      tag = tag.strip()
40#      print 'Found tag %s corresponding to CVS revision %s\n'\
41#            %(tag, revision.strip())
42#      break
43#
44#    if string.find(line, 'symbolic names:') == 0:
45#      found = 1
46#
47#     
48#i = string.find(tag,'-')
49#rev = string.replace( tag[i:], '-', '_' )
50
51
52
53curdir = os.getcwd()
54os.chdir('/tmp')
55     
56     
57# Export a clean directory
58#s = 'cvs export -r %s %s' %(tag, package)
59s = 'svn export %s %s' %(curdir, package)
60print s
61os.system(s)
62
63#import sys; sys.exit()
64
65
66release_name  = package + "_" + rev
67s = 'mv %s %s' %(package, release_name)
68print s
69os.system(s)
70
71# Create installation tree
72
73s = 'mkdir %s/lib %s/lib/pypar %s/examples' %((release_name,)*3)
74print s
75os.system(s)
76
77#cleanup dev stuff that shouldn't go into package
78s = '/bin/rm %s/install.py %s/compile.py %s/Makefile' %((release_name,)*3)
79print s
80os.system(s)
81
82s = 'mv %s/pypar.py %s/lib/pypar' %((release_name,)*2)
83print s
84os.system(s)
85
86s = 'mv %s/__init__.py %s/lib/pypar' %((release_name,)*2)
87print s
88os.system(s)
89
90s = 'mv %s/mpiext.c %s/lib/pypar' %((release_name,)*2)
91print s
92os.system(s)
93
94s = 'mv %s/*.py %s/examples' %((release_name,)*2)
95print s
96os.system(s)
97
98s = 'mv %s/examples/setup.py %s' %((release_name,)*2)
99print s
100os.system(s)
101
102s = 'mv %s/pytiming %s/examples' %((release_name,)*2)
103print s
104os.system(s)
105
106s = 'mv %s/ring_example.py %s/examples' %((release_name,)*2)
107print s
108os.system(s)
109
110s = 'mv %s/runpytiming %s/examples' %((release_name,)*2)
111print s
112os.system(s)
113
114s = 'mv %s/ctiming.c %s/examples' %((release_name,)*2)
115print s
116os.system(s)
117
118# Make tarball and copy to destination
119s = 'tar cvfz %s.tgz %s' %(release_name, release_name)
120print s
121os.system(s)
122
123s = 'cp %s.tgz %s' %(release_name, destination)
124print s
125os.system(s)
126
127s = 'cp %s/lib/pypar/pypar.py %s' %(release_name, destination)
128print s
129os.system(s)
130
131s = 'cp %s/lib/pypar/mpiext.c %s' %(release_name, destination)
132print s
133os.system(s)
134
135s = 'cp %s/examples/pytiming %s' %(release_name, destination)
136print s
137os.system(s)
138
139s = 'cp %s/examples/ctiming.c %s' %(release_name, destination)
140print s
141os.system(s)
142
143s = 'cp %s/examples/ring_example.py %s' %(release_name, destination)
144print s
145os.system(s)
146
147s = 'cp %s/README %s' %(release_name, destination)
148print s
149os.system(s)
150
151s = 'cp %s/DOC %s' %(release_name, destination)
152print s
153os.system(s)
154
155# Update web page
156#
157print 'Updating WEB page ' + destination
158input = open(destination + '/' + 'index.src', 'r')
159output = open(destination + '/' + 'index.php', 'w')
160
161output.write('<!-- AUTOMATICALLY GENERATED - EDIT index.src instead -->\n')
162for line in input.readlines():
163  line = string.replace(line, '<date>', date) 
164  output.write(string.replace(line,'<filename>',release_name+'.tgz'))
165output.close()   
166
167#os.system('mv %s.tgz /home/web/dm_web/software/%s' %(release_name, package))
168#os.system('cp %s/README /home/web/dm_web/software/%s' %(release_name, package))
169#os.system('cp %s/DOC /home/web/dm_web/software/%s' %(release_name, package))
170
171# Make soft link
172#
173s = 'cd %s; rm pypar.tgz; ln -s %s.tgz pypar.tgz' %(destination, release_name)
174print s
175os.system(s)
176
177#Cleanup
178s = '/bin/rm -f -r %s' %release_name
179print s
180os.system(s)
181
182
Note: See TracBrowser for help on using the repository browser.