#!/usr/bin/env python # # Performs a release of Review Board. This can only be run by the core # developers with release permissions. # import os import re import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from rbtools import get_package_version, VERSION PY_VERSIONS = ["2.4", "2.5", "2.6"] LATEST_PY_VERSION = PY_VERSIONS[-1] PACKAGE_NAME = 'RBTools' RELEASES_URL = \ 'review-board.org:/var/www/downloads.review-board.org/' \ 'htdocs/releases/%s/%s.%s/' % (PACKAGE_NAME, VERSION[0], VERSION[1]) built_files = [] def execute(cmdline): print ">>> %s" % cmdline if os.system(cmdline) != 0: print "!!! Error invoking command." sys.exit(1) def run_setup(target, pyver = LATEST_PY_VERSION): execute("python%s ./setup.py release %s" % (pyver, target)) def build_targets(): for pyver in PY_VERSIONS: run_setup("bdist_egg", pyver) built_files.append("dist/%s-%s-py%s.egg" % (PACKAGE_NAME, get_package_version(), pyver)) run_setup("sdist") built_files.append("dist/%s-%s.tar.gz" % (PACKAGE_NAME, get_package_version())) def build_news(): def linkify_bugs(line): return re.sub(r'(Bug #(\d+))', r'\1', line) content = "" html_content = "" saw_version = False in_list = False in_item = False fp = open("NEWS", "r") for line in fp.xreadlines(): line = line.rstrip() if line.startswith("version "): if saw_version: # We're done. break saw_version = True elif line.startswith("\t* "): if in_item: html_content += "\n" in_item = False if in_list: html_content += "\n" html_content += "
%s
\n" % line[3:] html_content += "