converted steps to functions for easier step selection

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4783 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-10-20 14:18:37 +00:00
parent 36dfefcf4b
commit 869fdd42f8

View file

@ -91,7 +91,7 @@ CVS_TAG = 'v' + ''.join(VERSION.split('.'))
newverdir = 'nsis-%s-src' % VERSION newverdir = 'nsis-%s-src' % VERSION
### some useful functions ### utility functions
def log(msg, log_dir = '.'): def log(msg, log_dir = '.'):
open('%s\\release-%s.log' % (log_dir, VERSION), 'a').write(msg + '\n') open('%s\\release-%s.log' % (log_dir, VERSION), 'a').write(msg + '\n')
@ -125,17 +125,16 @@ def confirm(question):
if raw_input() != 'y': if raw_input() != 'y':
sys.exit(2) sys.exit(2)
### confirm ### process functions
def Confirm():
confirm('are you sure you want to release version %s?' % VERSION) confirm('are you sure you want to release version %s?' % VERSION)
confirm('did you update history.but?') confirm('did you update history.but?')
### start log def StartLog():
open('release-%s.log' % VERSION, 'w').write('releasing version %s at %s\n\n' % (VERSION, time.ctime())) open('release-%s.log' % VERSION, 'w').write('releasing version %s at %s\n\n' % (VERSION, time.ctime()))
### test def RunTests():
print 'running tests...' print 'running tests...'
run( run(
@ -144,8 +143,7 @@ run(
'tests failed - see test.log for details' 'tests failed - see test.log for details'
) )
### create images def CreateMenuImage():
print 'creating images...' print 'creating images...'
## create new header.gif for menu ## create new header.gif for menu
@ -169,8 +167,7 @@ draw.text((85, 7), text, font = font, fill = 'white')
im = im.convert('P', palette = Image.ADAPTIVE) im = im.convert('P', palette = Image.ADAPTIVE)
im.save(r'..\Menu\images\header.gif') im.save(r'..\Menu\images\header.gif')
# commit header.gif def CommitMenuImage():
print 'committing header.gif...' print 'committing header.gif...'
run( run(
@ -179,8 +176,7 @@ run(
'failed committing header.gif' 'failed committing header.gif'
) )
### test installer def TestInstaller():
print 'testing installer...' print 'testing installer...'
os.mkdir('insttestscons') os.mkdir('insttestscons')
@ -204,8 +200,7 @@ run(
1 1
) )
### tag def Tag():
print 'tagging...' print 'tagging...'
run( run(
@ -214,8 +209,7 @@ run(
'failed creating tag %s' % CVS_TAG 'failed creating tag %s' % CVS_TAG
) )
### export def Export():
print 'exporting a fresh copy...' print 'exporting a fresh copy...'
run( run(
@ -224,8 +218,7 @@ run(
'export failed' 'export failed'
) )
### create source tarball def CreateSourceTarball():
print 'creating source tarball...' print 'creating source tarball...'
run( run(
@ -234,8 +227,7 @@ run(
'source tarball creation failed' 'source tarball creation failed'
) )
### build release files def BuildRelease():
scons_line = 'scons -C %s VERSION=%s VER_MAJOR=%s VER_MINOR=%s VER_REVISION=%s VER_BUILD=%s ' \ scons_line = 'scons -C %s VERSION=%s VER_MAJOR=%s VER_MINOR=%s VER_REVISION=%s VER_BUILD=%s ' \
% (newverdir, VERSION, VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD) % (newverdir, VERSION, VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
@ -247,6 +239,7 @@ run(
'creation of distribution files failed' 'creation of distribution files failed'
) )
def CreateSpecialBuilds():
def create_special_build(name, option): def create_special_build(name, option):
print 'creating %s special build...' % name print 'creating %s special build...' % name
@ -270,8 +263,7 @@ def create_special_build(name, option):
create_special_build('strlen_8192', 'NSIS_MAX_STRLEN=8192') create_special_build('strlen_8192', 'NSIS_MAX_STRLEN=8192')
create_special_build('log', 'NSIS_CONFIG_LOG=yes') create_special_build('log', 'NSIS_CONFIG_LOG=yes')
### upload files to SourceForge def UploadFiles():
print 'uploading files to SourceForge...' print 'uploading files to SourceForge...'
def upload(ftp, file): def upload(ftp, file):
@ -289,10 +281,7 @@ upload(ftp, 'nsis-%s-strlen_8192.zip' % VERSION)
ftp.quit() ftp.quit()
### update some websites... def ManualRelease():
# manual release
print 'release url:' print 'release url:'
print ' http://sourceforge.net/project/admin/qrs.php?package_id=0&group_id=22049' print ' http://sourceforge.net/project/admin/qrs.php?package_id=0&group_id=22049'
print print
@ -300,8 +289,9 @@ print
sys.stdout.write('What\'s the SF release id of the new version? ') sys.stdout.write('What\'s the SF release id of the new version? ')
release_id = raw_input() release_id = raw_input()
# update wiki return release_id
def UpdateWiki(release_id):
print 'updating wiki...' print 'updating wiki...'
def update_wiki_page(page, data, summary): def update_wiki_page(page, data, summary):
@ -323,24 +313,42 @@ update_wiki_page('Template:NSISVersion', VERSION, 'new version')
update_wiki_page('Template:NSISReleaseDate', time.strftime('%B %d, %Y'), 'new version') update_wiki_page('Template:NSISReleaseDate', time.strftime('%B %d, %Y'), 'new version')
update_wiki_page('Template:NSISReleaseID', release_id, 'new version') update_wiki_page('Template:NSISReleaseID', release_id, 'new version')
# update changelog start time def UpdateChangeLog():
run( run(
'%s touch /home/groups/n/ns/nsis/bin/cl.timestamp' % RSH, '%s touch /home/groups/n/ns/nsis/bin/cl.timestamp' % RSH,
'cl-timestamp', 'cl-timestamp',
'change log start time modification failed' 'change log start time modification failed'
) )
### still left to do def ToDo():
print 'automatic phase done\n' print 'automatic phase done\n'
print """ print """
* Edit update.php * Edit update.php
* Post news item
* http://en.wikipedia.org/w/index.php?title=Nullsoft_Scriptable_Install_System&action=edit * http://en.wikipedia.org/w/index.php?title=Nullsoft_Scriptable_Install_System&action=edit
* Update Freshmeat * Update Freshmeat
* Update BetaNews * Update BetaNews
""" """
### all done def CloseLog():
log('done') log('done')
### ok, let's go!
Confirm()
StartLog()
RunTests()
CreateMenuImage()
CommitMenuImage()
TestInstaller()
Tag()
Export()
CreateSourceTarball()
BuildRelease()
CreateSpecialBuilds()
UploadFiles()
release_id = ManualRelease()
UpdateWiki(release_id)
UpdateChangeLog()
ToDo()
CloseLog()