source: pypar/release @ 907

Last change on this file since 907 was 123, checked in by ole, 19 years ago

Files for 64 bit machine + latest Cvs version

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