Changeset 4531
- Timestamp:
- Jun 4, 2007, 4:58:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
create_distribution.py
r4384 r4531 23 23 from os import sep, system, remove 24 24 from tempfile import mktemp 25 from sys import platform 25 from sys import platform, stdout 26 26 from anuga.utilities.system_tools import get_user_name, get_host_name 27 27 from anuga.abstract_2d_finite_volumes.util import get_revision_number … … 38 38 major_revision = '1.0beta' 39 39 40 41 # Refresh sandpit and retrieve svn revision number 42 # from last line in svn update output 43 #filename = mktemp() + '.txt' 44 #s = 'svn update > %s' %filename 45 #print s 46 #system(s) 47 # 48 #fid = open(filename) 49 #last_line = fid.readlines()[-1] 50 #remove(filename) 51 #if not (last_line.startswith('At revision') or\ 52 # last_line.startswith('Updated to revision')): 53 # msg = 'Unexpected output from svn up: %s' %last_line 54 # raise Exception, msg 55 # 56 #fields = last_line.split() 57 #svn_revision = fields[-1][:-1] 58 59 # Get revision number and create 40 # line separator 41 lsep = '----------------------------------------------------------------------' 42 43 44 # Get svn revision number and create 60 45 # file with version info for release. 61 46 # This will mean that the version currently checked out is … … 176 161 177 162 #----------------------------- 178 # Copy anuga_viewer 179 s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s'\ 180 %(distro_dir) 181 print s 182 system(s) 183 184 # Move distro to release area 185 s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir) 186 print s 187 system(s) 163 # Copy and rename anuga_viewer 164 s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s/anuga_viewer-%s.tgz' %(distro_dir, revision) 165 print s 166 system(s) 167 168 169 # Move viewer to release area 170 s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir) 171 print s 172 system(s) 173 174 188 175 189 176 #----------------------------- 190 177 # Hey, why not compile and bundle up the LaTeX documentation as well 191 178 179 print 180 print lsep 181 print 'Preparing User Manual (see update_anuga_user_manual.log)' 182 print lsep 192 183 s = 'cd anuga_core/documentation/user_manual;' 193 184 s += 'python update_anuga_user_manual.py --no_html' 194 185 print s 195 system(s )186 system(s + ' 1>update_anuga_user_manual.log 2>/dev/null') 196 187 197 188 release_name = 'anuga_user_manual-%s.pdf' %revision … … 201 192 system(s) 202 193 203 204 194 release_name = 'anuga_installation_guide-%s.pdf' %revision 205 195 s = '/bin/mv anuga_core/documentation/user_manual/anuga_installation_guide.pdf %s/%s' %(release_dir, release_name) … … 209 199 210 200 211 212 #----------------------------- 201 #----------------------------- 202 213 203 print 'Done' 214 204 print 215 205 print 206 print lsep 216 207 print 'The release files are in %s:' %release_dir 217 208 system('ls -la %s' %release_dir) 209 print lsep 210 print 211 print 212 213 answer = raw_input('Do you want to upload this to sourceforge? Y/N [Y]') 214 if answer.lower() != 'n': 215 216 #------------------------------ 217 print 'Uploading to sourceforge' 218 219 220 import os, os.path 221 release_dir = os.path.expanduser(release_dir) 222 os.chdir(release_dir) 223 print 'Reading from', os.getcwd() 224 225 226 from ftplib import FTP 227 ftp = FTP('upload.sourceforge.net') 228 print ftp.login() # Anonymous 229 print ftp.cwd('incoming') 230 231 232 for filename in os.listdir('.'): 233 print 'Uploading %s... ' %filename, 234 stdout.flush() 235 236 fid=open(filename, 'rb') 237 print ftp.storbinary('STOR %s' %filename, fid) 238 fid.close() 239 240 print 'FTP done' 241 print ftp.quit() 242 243 print 244 print lsep 245 print ' ********************* NOTE *************************' 246 print lsep 247 print 'To complete this release you must log into' 248 print 'http://sourceforge.net/projects/anuga as ANUGA admin' 249 print 'and complete the process by selecting File Releases ' 250 print 'in the admin menu there.' 251 print lsep 252 print 253 print 254 218 255 219 256 … … 225 262 if get_user_name() == 'ole' and get_host_name() == 'nautilus': 226 263 264 print 'Attempt to rsync data to perlite and datamining' 227 265 # Copy to RAMP 228 266 s = 'rsync -avz %s/* onielsen@cyclone:/d/cit/1/cit/natural_hazard_impacts/downloads/ANUGA_install/%s' %(release_dir, 'anuga_%s' %revision) … … 235 273 236 274 # Copy to the ANU 237 238 s = 'rsync -avz %s/* ole@datamining.anu.edu.au:public_html/software/anuga/%s' %(release_dir, 'anuga_%s' %revision) 239 print s 240 system(s) 241 242 275 #s = 'rsync -avz %s/* ole@datamining.anu.edu.au:public_html/software/anuga/%s' %(release_dir, 'anuga_%s' %revision) 276 #print s 277 #system(s) 278 279
Note: See TracChangeset
for help on using the changeset viewer.