diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-07-08 13:49:30 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-07-08 13:49:30 (GMT) |
commit | 8cc395cae98d32b243239c19d1a50a9586b53f44 (patch) | |
tree | 79913cf4ac2eca0ad3760c2110a8c78ba4d5a181 /sugar | |
parent | 68e40429fb88bc04f8b006fa0dfc7a44609a5cbf (diff) |
Make setup.py release add version to the NEWS file.
Add the news for the release to the global NEWS.sugar.
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/activity/bundlebuilder.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sugar/activity/bundlebuilder.py b/sugar/activity/bundlebuilder.py index e4e6f19..a412d17 100644 --- a/sugar/activity/bundlebuilder.py +++ b/sugar/activity/bundlebuilder.py @@ -254,6 +254,47 @@ def cmd_release(bundle_name, manifest): f.write(info) f.close() + news_path = os.path.join(_get_source_path(), 'NEWS') + + if os.environ.has_key('SUGAR_NEWS'): + print 'Update NEWS.sugar' + + sugar_news_path = os.environ['SUGAR_NEWS'] + if os.path.isfile(sugar_news_path): + f = open(sugar_news_path,'r') + sugar_news = f.read() + f.close() + else: + sugar_news = '' + + sugar_news += '%s - %d\n\n' % (bundle_name, version) + + f = open(news_path,'r') + for line in f.readline(): + if len(line) > 0: + sugar_news += line + else: + break + f.close() + + sugar_news += '\n' + + f = open(sugar_news_path, 'w') + f.write(sugar_news) + f.close() + + print 'Update NEWS...' + + f = open(news_path,'r') + news = f.read() + f.close() + + news = '%d\n\n' % version + news + + f = open(news_path, 'w') + f.write(news) + f.close() + print 'Committing to git...' changelog = 'Release version %d.' % version |