qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jr...@apache.org
Subject svn commit: r1711024 - in /qpid/site: ./ python/ python/qpid_site/ scripts/
Date Wed, 28 Oct 2015 14:46:30 GMT
Author: jross
Date: Wed Oct 28 14:46:29 2015
New Revision: 1711024

URL: http://svn.apache.org/viewvc?rev=1711024&view=rev
Log:
QPID-6773: Update release scripts

 - Allow overrides for jira and source repo release keys
   - Now can you can specify ISSUES_RELEASE and SOURCE_RELEASE
     in addition to RELEASE in the generate invocation
 - Use updated scripting functions

Added:
    qpid/site/python/generate.py
    qpid/site/python/plano.py
Removed:
    qpid/site/python/qpid_site/
Modified:
    qpid/site/Makefile
    qpid/site/README
    qpid/site/scripts/gen-cpp-release-api-doc
    qpid/site/scripts/gen-cpp-release-books
    qpid/site/scripts/gen-cpp-release-examples
    qpid/site/scripts/gen-cpp-release-notes
    qpid/site/scripts/gen-cpp-release-page
    qpid/site/scripts/gen-dispatch-release-api-doc
    qpid/site/scripts/gen-dispatch-release-books
    qpid/site/scripts/gen-dispatch-release-notes
    qpid/site/scripts/gen-dispatch-release-page
    qpid/site/scripts/gen-java-release-books
    qpid/site/scripts/gen-java-release-examples
    qpid/site/scripts/gen-java-release-notes
    qpid/site/scripts/gen-java-release-page
    qpid/site/scripts/gen-jms-release-docs
    qpid/site/scripts/gen-jms-release-notes
    qpid/site/scripts/gen-jms-release-page
    qpid/site/scripts/gen-proton-release-api-doc
    qpid/site/scripts/gen-proton-release-examples
    qpid/site/scripts/gen-proton-release-notes
    qpid/site/scripts/gen-proton-release-page

Modified: qpid/site/Makefile
URL: http://svn.apache.org/viewvc/qpid/site/Makefile?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/Makefile (original)
+++ qpid/site/Makefile Wed Oct 28 14:46:29 2015
@@ -7,6 +7,16 @@ endif
 OUTPUT_DIR := output
 SITE_URL := file://$(shell readlink -f ${OUTPUT_DIR})
 
+ifdef RELEASE
+    ifndef ISSUES_RELEASE
+        ISSUES_RELEASE := ${RELEASE}
+    endif
+
+    ifndef SOURCE_RELEASE
+        SOURCE_RELEASE := ${RELEASE}
+    endif
+endif
+
 default: render
 
 help:
@@ -53,39 +63,38 @@ clean:
 	rm -rf ${OUTPUT_DIR}
 	find python -name \*.pyc -delete
 
+gen-amqp-type-reference:
+	scripts/gen-amqp-type-reference misc/amqp > input/amqp/type-reference.html.in
+
 gen-proton-release: gen-proton-release-page gen-proton-release-notes gen-proton-release-api-doc gen-proton-release-examples
 
 gen-dispatch-release: gen-dispatch-release-page gen-dispatch-release-notes gen-dispatch-release-books
 
-gen-jms-release: gen-jms-release-page gen-jms-release-notes gen-jms-release-docs
-
 gen-java-release: gen-java-release-page gen-java-release-notes gen-java-release-books gen-java-release-examples
 
-gen-cpp-release: gen-cpp-release-page gen-cpp-release-notes gen-cpp-release-api-doc gen-cpp-release-examples gen-cpp-release-books
+gen-jms-release: gen-jms-release-page gen-jms-release-notes gen-jms-release-docs
 
-gen-release-%: RELEASE_DIR := input/releases/qpid-${RELEASE}
-gen-release-%:
-	scripts/gen-release-$* ${RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
+gen-cpp-release: gen-cpp-release-page gen-cpp-release-notes gen-cpp-release-api-doc gen-cpp-release-examples gen-cpp-release-books
 
 gen-proton-release-%: RELEASE_DIR := input/releases/qpid-proton-${RELEASE}
-gen-proton-release-%:
-	scripts/gen-proton-release-$* ${RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
+gen-proton-release-%: 
+	scripts/gen-proton-release-$* ${RELEASE} ${ISSUES_RELEASE} ${SOURCE_RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
 
 gen-dispatch-release-%: RELEASE_DIR := input/releases/qpid-dispatch-${RELEASE}
 gen-dispatch-release-%:
-	scripts/gen-dispatch-release-$* ${RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
+	scripts/gen-dispatch-release-$* ${RELEASE} ${ISSUES_RELEASE} ${SOURCE_RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
 
 gen-java-release-%: RELEASE_DIR := input/releases/qpid-java-${RELEASE}
 gen-java-release-%:
-	scripts/gen-java-release-$* ${RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
+	scripts/gen-java-release-$* ${RELEASE} ${ISSUES_RELEASE} ${SOURCE_RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
 
 gen-jms-release-%: RELEASE_DIR := input/releases/qpid-jms-${RELEASE}
 gen-jms-release-%:
-	scripts/gen-jms-release-$* ${RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
+	scripts/gen-jms-release-$* ${RELEASE} ${ISSUES_RELEASE} ${SOURCE_RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
 
 gen-cpp-release-%: RELEASE_DIR := input/releases/qpid-cpp-${RELEASE}
 gen-cpp-release-%:
-	scripts/gen-cpp-release-$* ${RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
+	scripts/gen-cpp-release-$* ${RELEASE} ${ISSUES_RELEASE} ${SOURCE_RELEASE} ${RELEASE_DIR} ${CHECKOUT_DIR}
 
-gen-amqp-type-reference:
-	scripts/gen-amqp-type-reference misc/amqp > input/amqp/type-reference.html.in
+update-plano:
+	curl "https://raw.githubusercontent.com/ssorj/plano/master/python/plano.py" -o python/plano.py

Modified: qpid/site/README
URL: http://svn.apache.org/viewvc/qpid/site/README?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/README (original)
+++ qpid/site/README Wed Oct 28 14:46:29 2015
@@ -137,10 +137,15 @@ These will produce a new tree of release
 books.  Once generated, you can make any edits you'd like and check it
 in.
 
+In addition to specifying `RELEASE`, you can override the particular
+release identifier used for querying issues and exporting source using
+`ISSUES_RELEASE` and `SOURCE_RELEASE` respectively.  If not set,
+`ISSUES_RELEASE` and `SOURCE_RELEASE` take the value of `RELEASE`.
+
 By default, the scripts will fetch the source for you based on the
-release.  By setting the optional `CHECKOUT_DIR` parameter to the
-location of a local Subversion checkout, the scripts will instead use
-the provided content.
+release script inputs.  By setting the optional `CHECKOUT_DIR`
+parameter to the location of a local Subversion checkout, the scripts
+will instead use the provided content.
 
 When you add release content, you should also update the following
 files:

Added: qpid/site/python/generate.py
URL: http://svn.apache.org/viewvc/qpid/site/python/generate.py?rev=1711024&view=auto
==============================================================================
--- qpid/site/python/generate.py (added)
+++ qpid/site/python/generate.py Wed Oct 28 14:46:29 2015
@@ -0,0 +1,440 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import re
+import urllib
+import yaml
+
+from pprint import pformat
+from pygments import highlight as pygments_highlight
+from pygments.lexers import get_lexer_by_name
+from pygments.formatters import HtmlFormatter
+from xml.sax.saxutils import escape as escape_html
+
+from plano import *
+
+## General ##
+
+def setup_release_script():
+    if len(ARGS) not in (5, 6):
+        exit("Usage: script RELEASE ISSUES_RELEASE SOURCE_RELEASE RELEASE-DIR [CHECKOUT-DIR]")
+
+    notice("Setting up script '{}'", ARGS[0])
+
+    release = ARGS[1]
+    issues_release = ARGS[2]
+    source_release = ARGS[3]
+    release_dir = ARGS[4]
+
+    try:
+        checkout_dir = ARGS[5]
+    except IndexError:
+        checkout_dir = None
+
+    assert release != ""
+    assert issues_release != ""
+    assert source_release != ""
+    assert release_dir != ""
+    assert checkout_dir is None or checkout_dir != ""
+
+    call("cmake --version > /dev/null")
+    call("dot -V > /dev/null")
+    call("doxygen --version > /dev/null")
+    call("epydoc --version > /dev/null")
+    call("fop -version > /dev/null")
+    call("gcc --version > /dev/null")
+    call("make --version > /dev/null")
+    call("rdoc --version > /dev/null")
+    call("sphinx-build --version > /dev/null")
+    call("svn --version > /dev/null")
+    call("which javadoc > /dev/null")
+    call("xsltproc --version > /dev/null")
+
+    notice("Release script inputs:")
+    notice("  release:         {}", pformat(release))
+    notice("  issues_release:  {}", pformat(issues_release))
+    notice("  source_release:  {}", pformat(source_release))
+    notice("  release_dir:     {}", pformat(release_dir))
+    notice("  checkout_dir:    {}", pformat(checkout_dir))
+
+    make_dir(release_dir)
+
+    return (release, issues_release, source_release, release_dir, checkout_dir)
+
+def get_release_branch_url(module, release):
+    project_url = "http://svn.apache.org/repos/asf/qpid"
+
+    if module == "main":
+        path = "branches/{}/qpid".format(release)
+
+        if release == "trunk":
+            path = "trunk/qpid"
+
+        return "{}/{}".format(project_url, path)
+    elif module == "cpp":
+        path = "branches/qpid-cpp-{}-rc/qpid".format(release)
+
+        if release == "trunk":
+            path = "trunk/qpid"
+        
+        return "{}/{}".format(project_url, path)
+
+    path = "{}/branches/{}".format(module, release)
+
+    if release == "trunk":
+        path = "{}/trunk".format(module, release)
+
+    return "{}/{}".format(project_url, path)
+
+def get_git_release_branch_url(module, release, path=""):
+    """
+    Get a URL to file path in GitHub
+
+    If called without PATH it returns a URL that you can append paths
+    to.
+    """
+    modules = {
+        "proton": "https://github.com/apache/qpid-proton/tree"
+    }
+
+    if release == "trunk":
+        release = "master"
+
+    return "{}/{}/{}".format(modules[module], release, path.lstrip("/"))
+
+def export_release(module, release, checkout_dir):
+    temp_dir = make_user_temp_dir()
+    dir_name = "qpid-{}-{}".format(module, release)
+    export_dir = join(temp_dir, "transom", dir_name)
+
+    if is_dir(export_dir):
+        debug("Export already exists")
+        return export_dir
+
+    remove(export_dir)
+    make_dir(split(export_dir)[0])
+
+    uri = get_release_branch_url(module, release)
+
+    if checkout_dir is not None:
+        uri = checkout_dir
+
+    call("svn export {} {}", uri, export_dir)
+
+    return export_dir
+
+def export_release_from_git(module, release):
+    work_dir = make_temp_dir()
+    user_temp_dir = make_user_temp_dir()
+    dir_name = "qpid-{}-{}".format(module, release)
+    export_dir = join(user_temp_dir, "transom", dir_name)
+    url = "http://git-wip-us.apache.org/repos/asf/qpid-{}.git".format(module)
+
+    if is_dir(export_dir):
+        debug("Export already exists")
+        return export_dir
+
+    make_dir(export_dir)
+
+    with working_dir(work_dir):
+        call("git clone --bare --branch '{}' '{}' .", release, url)
+        call("git archive '{}' | tar -xf - -C '{}'", release, export_dir)
+
+    return export_dir
+
+## API reference ##
+
+_doxygen_conf_template = u"""
+DISABLE_INDEX = yes
+EXTRACT_ALL = yes
+GENERATE_HTML = yes
+GENERATE_LATEX = no
+GENERATE_TREEVIEW = yes
+HAVE_DOT = no
+PROJECT_NUMBER = {release}
+QUIET = yes
+RECURSIVE = yes
+INPUT = {input_paths}
+PROJECT_NAME = "{title}"
+STRIP_FROM_PATH = {strip_paths}
+HTML_OUTPUT = {output_dir}
+"""
+
+def gen_doxygen(release, title, input_paths, strip_paths, output_dir):
+    input_paths = " ".join(input_paths)
+    strip_paths = " ".join(strip_paths)
+
+    make_dir(output_dir)
+
+    conf = _doxygen_conf_template.format(**locals())
+    path = write_temp("conf", conf)
+
+    call("doxygen {}", path)
+
+    touch(join(output_dir, "_transom_ignore_pages"))
+
+def gen_epydoc(release, title, input_paths, input_namespaces, output_dir):
+    input_paths = ":".join(input_paths)
+    input_namespaces = " ".join(input_namespaces)
+
+    make_dir(output_dir)
+
+    options = list()
+    options.append("--graph all")
+    options.append("--html")
+    options.append("--name \"{}\"".format(title))
+    options.append("--no-private")
+    options.append("--output {}".format(output_dir))
+    options.append("--quiet")
+    options.append("--url \"http://qpid.apache.org/index.html\"")
+    options = " ".join(options)
+
+    call("PYTHONPATH={} epydoc {} {}", input_paths, options, input_namespaces)
+
+    touch(join(output_dir, "_transom_ignore_pages"))
+
+def gen_javadoc(release, title, input_paths, input_namespaces, output_dir):
+    input_paths = ":".join(input_paths)
+    input_namespaces = ":".join(input_namespaces)
+
+    make_dir(output_dir)
+
+    options = list()
+    options.append("-windowtitle \"{}\"".format(title))
+    options.append("-doctitle \"{}\"".format(title))
+    options.append("-sourcepath {}".format(input_paths))
+    options.append("-subpackages {}".format(input_namespaces))
+    options.append("-d {}".format(output_dir))
+    options.append("-notimestamp")
+    options = " ".join(options)
+
+    call("javadoc {}", options)
+
+    touch(join(output_dir, "_transom_ignore_pages"))
+
+def gen_rdoc(release, title, base_input_path, input_paths, output_dir):
+    output_dir = absolute_path(output_dir)
+
+    # rdoc really wants to make the last dir
+    make_dir(parent_dir(output_dir))
+
+    options = list()
+    options.append("--fmt html")
+    options.append("--op {}".format(output_dir))
+    options.append("--quiet")
+    options.append("--title \"{}\"".format(title))
+    options = " ".join(options)
+
+    input_paths = " ".join(input_paths)
+
+    call("cd {} && rdoc {} {}", base_input_path, options, input_paths)
+    
+    touch(join(output_dir, "_transom_ignore_pages"))
+
+## Examples ##
+
+def gen_examples(release, title, lang, input_dir, input_names, output_dir,
+                 readme_url=None, source_url=None):
+    remove(output_dir)
+
+    notice("Generating {}", title)
+
+    for name in input_names:
+        gen_example_page(release=release,
+                         input_dir=input_dir,
+                         input_name=name,
+                         output_dir=output_dir,
+                         lang=lang)
+
+    gen_examples_index(release=release,
+                       input_names=input_names,
+                       output_dir=output_dir,
+                       title=title,
+                       readme_url=readme_url,
+                       source_url=source_url)
+
+_example_page_template = u"""
+<h1>{title}</h1>
+{content}
+<p><a href="{input_name}">Download this file</a></p>
+"""
+
+def gen_example_page(release, input_dir, input_name, output_dir, lang):
+    input_path = join(input_dir, input_name)
+    output_path = join(output_dir, input_name)
+    html_output_path = join(output_dir, "{}.html.in".format(input_name))
+
+    content = read(input_path)
+    content = strip_license_header(content, lang)
+    content = content.strip()
+    content = highlight(content, lang)
+
+    title = input_name
+    html = _example_page_template.format(**locals())
+
+    copy(input_path, output_path)
+    write(html_output_path, html)
+
+_formatter = HtmlFormatter(linenos=False)
+
+def highlight(string, lang):
+    lexer = get_lexer_by_name(lang)
+    return pygments_highlight(string, lexer, _formatter)
+
+_license_header_regexes = {
+    "c": re.compile(r"/\*.*?\*/", re.DOTALL),
+    "cpp": re.compile(r"/\*.*?\*/", re.DOTALL),
+    "csharp": re.compile(r"/\*.*?\*/", re.DOTALL),
+    "java": re.compile(r"/\*.*?\*/", re.DOTALL),
+    "php": re.compile(r"/\*.*?\*/", re.DOTALL),
+    }
+
+def strip_license_header(string, lang):
+    if lang in _license_header_regexes:
+        regex = _license_header_regexes[lang]
+        return re.sub(regex, "", string)
+    elif lang in ("perl", "python", "ruby", "ini"):
+        input_lines = string.split(LINE_SEP)
+        output_lines = list()
+
+        for i, line in enumerate(input_lines):
+            if not line.startswith("#") and line != "":
+                output_lines.extend(input_lines[i:])
+                break
+
+        return LINE_SEP.join(output_lines)
+    else:
+        return string
+
+_examples_index_template = """
+# {title}
+
+## Example files
+
+{example_links}
+
+## More information
+
+{info_links}
+"""
+
+def gen_examples_index(release, input_names, output_dir, title,
+                       readme_url=None, source_url=None):
+    output_path = join(output_dir, "index.md")
+    example_links = list()
+    info_links = list()
+
+    for name in input_names:
+        example_links.append(" - [{}]({}.html)".format(name, name))
+
+    if readme_url:
+        info_links.append(" - [README]({})".format(readme_url))
+
+    if source_url:
+        info_links.append(" - [Source location]({})".format(source_url))
+
+    example_links = LINE_SEP.join(example_links)
+    info_links = LINE_SEP.join(info_links)
+    
+    index = _examples_index_template.format(**locals())
+
+    write(output_path, index)
+
+## Release notes ##
+
+def render_release_notes(project, release):
+    issues = _fetch_issues(project, release)
+    lines = list()
+
+    improvements = _render_issues(issues, "New Feature", "Improvement")
+    bugs = _render_issues(issues, "Bug")
+    tasks = _render_issues(issues, "Task")
+
+    if improvements is not None:
+        lines.append("\n## New features and improvements\n")
+        lines.append(improvements)
+
+    if bugs is not None:
+        lines.append("\n## Bugs fixed\n")
+        lines.append(bugs)
+
+    if tasks is not None:
+        lines.append("\n## Tasks\n")
+        lines.append(tasks)
+
+    return "\n".join(lines)
+
+def _fetch_issues(project, release):
+    query = list()
+
+    if project in ("qpid-cpp", "qpid-java"):
+        project = "qpid"
+
+    query.append("project = '{}'".format(project))
+    query.append("fixVersion = '{}'".format(release))
+    query.append("resolution = 'fixed'")
+
+    query = " and ".join(query)
+    query = "{} order by key asc".format(query)
+
+    page_size = 100
+
+    params = {
+        "jql": query,
+        "fields": "summary,issuetype",
+        "maxResults": page_size,
+        }
+
+    issues = list()
+    
+    for i in range(100):
+        params["startAt"] = i * page_size
+
+        url = "https://issues.apache.org/jira/rest/api/2/search?{}".format \
+            (urllib.urlencode(params))
+
+        filename, headers = urllib.urlretrieve(url)
+
+        with open(filename) as f:
+            data = yaml.load(f)
+
+        issues.extend(data["issues"])
+
+        if len(issues) >= int(data["total"]):
+            break
+
+    return issues
+
+def _render_issues(issues, *types):
+    filtered_issues = [x for x in issues
+                       if x["fields"]["issuetype"]["name"] in types]
+
+    if not filtered_issues:
+        return None
+
+    lines = list()
+
+    for issue in filtered_issues:
+        key = escape_html(issue["key"])
+        url = "https://issues.apache.org/jira/browse/{}".format(key)
+        summary = escape_html(issue["fields"]["summary"])
+
+        lines.append(" - [{}]({}) - {}".format(key, url, summary))
+
+    return "\n".join(lines)

Added: qpid/site/python/plano.py
URL: http://svn.apache.org/viewvc/qpid/site/python/plano.py?rev=1711024&view=auto
==============================================================================
--- qpid/site/python/plano.py (added)
+++ qpid/site/python/plano.py Wed Oct 28 14:46:29 2015
@@ -0,0 +1,515 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from __future__ import print_function
+
+import atexit as _atexit
+import codecs as _codecs
+import fnmatch as _fnmatch
+import getpass as _getpass
+import os as _os
+import random as _random
+import re as _re
+import shutil as _shutil
+import subprocess as _subprocess
+import sys as _sys
+import tarfile as _tarfile
+import tempfile as _tempfile
+import traceback as _traceback
+
+# See documentation at http://www.ssorj.net/projects/plano.html
+
+def fail(message, *args):
+    error(message, *args)
+
+    if isinstance(message, BaseException):
+        raise message
+
+    raise Exception(message)
+
+def error(message, *args):
+    _traceback.print_exc()
+    _print_message("Error", message, args, _sys.stderr)
+
+def warn(message, *args):
+    _print_message("Warn", message, args, _sys.stderr)
+
+def notice(message, *args):
+    _print_message(None, message, args, _sys.stdout)
+
+def debug(message, *args):
+    _print_message("Debug", message, args, _sys.stdout)
+
+def exit(message=None, *args):
+    if message is None:
+        _sys.exit()
+
+    _print_message("Error", message, args, _sys.stderr)
+
+    _sys.exit(1)
+
+def _print_message(category, message, args, file):
+    message = _format_message(category, message, args)
+
+    print(message, file=file)
+    file.flush()
+
+def _format_message(category, message, args):
+    if isinstance(message, BaseException):
+        message = str(message)
+
+        if message == "":
+            message = message.__class__.__name__
+
+    if category:
+        message = "{}: {}".format(category, message)
+
+    if args:
+        message = message.format(*args)
+
+    script = split(_sys.argv[0])[1]
+    message = "{}: {}".format(script, message)
+
+    return message
+
+absolute_path = _os.path.abspath
+normalize_path = _os.path.normpath
+exists = _os.path.exists
+is_absolute = _os.path.isabs
+is_dir = _os.path.isdir
+is_file = _os.path.isfile
+is_link = _os.path.islink
+
+join = _os.path.join
+split = _os.path.split
+split_extension = _os.path.splitext
+
+LINE_SEP = _os.linesep
+PATH_SEP = _os.sep
+ENV = _os.environ
+ARGS = _sys.argv
+
+current_dir = _os.getcwd
+
+def home_dir(user=""):
+    return _os.path.expanduser("~{}".format(user))
+
+def parent_dir(path):
+    path = normalize_path(path)
+    parent, child = split(path)
+
+    return parent
+
+def file_name(file):
+    file = normalize_path(file)
+    dir, name = split(file)
+
+    return name
+
+def name_stem(file):
+    name = file_name(file)
+
+    if name.endswith(".tar.gz"):
+        name = name[:-3]
+
+    stem, ext = split_extension(name)
+
+    return stem
+
+def name_extension(file):
+    name = file_name(file)
+    stem, ext = split_extension(name)
+    
+    return ext
+
+def read(file):
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        return f.read()
+
+def write(file, string):
+    with _codecs.open(file, encoding="utf-8", mode="w") as f:
+        f.write(string)
+
+    return file
+
+def append(file, string):
+    with _codecs.open(file, encoding="utf-8", mode="a") as f:
+        f.write(string)
+
+    return file
+
+def prepend(file, string):
+    orig = read(file)
+    prepended = string + orig
+
+    return write(file, prepended)
+
+def touch(file):
+    return append(file, "")
+
+def read_lines(file):
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        return f.readlines()
+
+def write_lines(file, lines):
+    with _codecs.open(file, encoding="utf-8", mode="r") as f:
+        f.writelines(lines)
+
+    return file
+
+def append_lines(file, lines):
+    with _codecs.open(file, encoding="utf-8", mode="a") as f:
+        f.writelines(string)
+
+    return file
+
+def prepend_lines(file, lines):
+    orig_lines = read_lines(file)
+
+    with _codecs.open(file, encoding="utf-8", mode="w") as f:
+        f.writelines(lines)
+        f.writelines(orig_lines)
+
+    return file
+
+_temp_dir = _tempfile.mkdtemp(prefix="plano.")
+
+def _get_temp_file(key):
+    assert not key.startswith("_")
+
+    return join(_temp_dir, "_file_{}".format(key))
+
+def _remove_temp_dir():
+    _shutil.rmtree(_temp_dir, ignore_errors=True)
+
+_atexit.register(_remove_temp_dir)
+
+def read_temp(key):
+    file = _get_temp_file(key)
+    return read(file)
+
+def write_temp(key, string):
+    file = _get_temp_file(key)
+    return write(file, string)
+
+def append_temp(key, string):
+    file = _get_temp_file(key)
+    return append(file, string)
+
+def prepend_temp(key, string):
+    file = _get_temp_file(key)
+    return prepend(file, string)
+
+def make_temp(key):
+    return append_temp(key, "")
+
+def open_temp(key, mode="r"):
+    file = _get_temp_file(key)
+    return _codecs.open(file, encoding="utf-8", mode=mode)
+
+# This one is deleted on process exit
+def make_temp_dir():
+    return _tempfile.mkdtemp(prefix="_dir_", dir=_temp_dir)
+
+# This one sticks around
+def make_user_temp_dir():
+    temp_dir = _tempfile.gettempdir()
+    user = _getpass.getuser()
+    user_temp_dir = join(temp_dir, user)
+
+    return make_dir(user_temp_dir)
+
+def copy(from_path, to_path):
+    notice("Copying '{}' to '{}'", from_path, to_path)
+
+    to_dir = parent_dir(to_path)
+
+    if to_dir:
+        make_dir(to_dir)
+
+    if is_dir(from_path):
+        _copytree(from_path, to_path, symlinks=True)
+    else:
+        _shutil.copy(from_path, to_path)
+
+    return to_path
+
+def move(from_path, to_path):
+    notice("Moving '{}' to '{}'", from_path, to_path)
+
+    _shutil.move(from_path, to_path)
+
+    return to_path
+
+def rename(path, expr, replacement):
+    path = normalize_path(path)
+    parent_dir, name = split(path)
+    to_name = string_replace(name, expr, replacement)
+    to_path = join(parent_dir, to_name)
+
+    notice("Renaming '{}' to '{}'", path, to_path)
+
+    move(path, to_path)
+
+    return to_path
+
+def remove(path):
+    notice("Removing '{}'", path)
+
+    if not exists(path):
+        return
+
+    if is_dir(path):
+        _shutil.rmtree(path, ignore_errors=True)
+    else:
+        _os.remove(path)
+
+    return path
+
+def make_link(source_path, link_file):
+    if exists(link_file):
+        assert read_link(link_file) == source_path
+        return
+
+    _os.symlink(source_path, link_file)
+
+    return link_file
+
+def read_link(file):
+    return _os.readlink(file)
+
+def find(dir, *patterns):
+    matched_paths = set()
+
+    if not patterns:
+        patterns = ("*",)
+
+    for root, dirs, files in _os.walk(dir):
+        for pattern in patterns:
+            matched_dirs = _fnmatch.filter(dirs, pattern)
+            matched_files = _fnmatch.filter(files, pattern)
+
+            matched_paths.update([join(root, x) for x in matched_dirs])
+            matched_paths.update([join(root, x) for x in matched_files])
+
+    return sorted(matched_paths)
+
+def find_any_one(dir, *patterns):
+    paths = find(dir, *patterns)
+
+    if len(paths) == 0:
+        return
+    
+    return paths[0]
+
+def find_only_one(dir, *patterns):
+    paths = find(dir, *patterns)
+
+    if len(paths) == 0:
+        return
+    
+    assert len(paths) == 1
+
+    return paths[0]
+
+# find_via_expr?
+
+def string_replace(string, expr, replacement, count=0):
+    return _re.sub(expr, replacement, string, count)
+
+def make_dir(dir):
+    if not exists(dir):
+        _os.makedirs(dir)
+
+    return dir
+
+# Returns the current working directory so you can change it back
+def change_dir(dir):
+    notice("Changing directory to '{}'", dir)
+
+    cwd = current_dir()
+    _os.chdir(dir)
+    return cwd
+
+def list_dir(dir, *patterns):
+    assert is_dir(dir)
+
+    names = _os.listdir(dir)
+
+    if not patterns:
+        return sorted(names)
+
+    matched_names = set()
+
+    for pattern in patterns:
+        matched_names.update(_fnmatch.filter(names, pattern))
+
+    return sorted(matched_names)
+
+class working_dir(object):
+    def __init__(self, dir):
+        self.dir = dir
+        self.prev_dir = None
+
+    def __enter__(self):
+        self.prev_dir = change_dir(self.dir)
+        return self.dir
+
+    def __exit__(self, type, value, traceback):
+        change_dir(self.prev_dir)
+
+def _init_call(command, args, kwargs):
+    if args:
+        command = command.format(*args)
+
+    if "shell" not in kwargs:
+        kwargs["shell"] = True
+
+    notice("Calling '{}'", command)
+
+    return command, kwargs
+
+def call(command, *args, **kwargs):
+    command, args = _init_call(command, args, kwargs)
+    _subprocess.check_call(command, **kwargs)
+
+def call_for_output(command, *args, **kwargs):
+    command, args = _init_call(command, args, kwargs)
+    return _subprocess.check_output(command, **kwargs)
+
+def make_archive(input_dir, output_dir, archive_stem):
+    temp_dir = make_temp_dir()
+    temp_input_dir = join(temp_dir, archive_stem)
+
+    copy(input_dir, temp_input_dir)
+    make_dir(output_dir)
+
+    output_file = "{}.tar.gz".format(join(output_dir, archive_stem))
+    output_file = absolute_path(output_file)
+
+    with working_dir(temp_dir):
+        call("tar -czf {} {}", output_file, archive_stem)
+
+    return output_file
+
+def extract_archive(archive_file, output_dir):
+    assert is_file(archive_file)
+
+    if not exists(output_dir):
+        make_dir(output_dir)
+
+    archive_file = absolute_path(archive_file)
+
+    with working_dir(output_dir):
+        call("tar -xf {}", archive_file)
+
+    return output_dir
+
+def rename_archive(archive_file, new_archive_stem):
+    assert is_file(archive_file)
+
+    if name_stem(archive_file) == new_archive_stem:
+        return
+
+    temp_dir = make_temp_dir()
+
+    extract_archive(archive_file, temp_dir)
+
+    input_name = list_dir(temp_dir)[0]
+    input_dir = join(temp_dir, input_name)
+    output_file = make_archive(input_dir, temp_dir, new_archive_stem)
+    output_name = file_name(output_file)
+    archive_dir = parent_dir(archive_file)
+    new_archive_file = join(archive_dir, output_name)
+
+    move(output_file, new_archive_file)
+    remove(archive_file)
+
+    return new_archive_file
+
+def random_port(min=49152, max=65535):
+    return _random.randint(min, max)
+
+# Modified copytree impl that allows for already existing destination
+# dirs
+def _copytree(src, dst, symlinks=False, ignore=None):
+    """Recursively copy a directory tree using copy2().
+
+    If exception(s) occur, an Error is raised with a list of reasons.
+
+    If the optional symlinks flag is true, symbolic links in the
+    source tree result in symbolic links in the destination tree; if
+    it is false, the contents of the files pointed to by symbolic
+    links are copied.
+
+    The optional ignore argument is a callable. If given, it
+    is called with the `src` parameter, which is the directory
+    being visited by copytree(), and `names` which is the list of
+    `src` contents, as returned by os.listdir():
+
+        callable(src, names) -> ignored_names
+
+    Since copytree() is called recursively, the callable will be
+    called once for each directory that is copied. It returns a
+    list of names relative to the `src` directory that should
+    not be copied.
+
+    XXX Consider this example code rather than the ultimate tool.
+
+    """
+    names = _os.listdir(src)
+    if ignore is not None:
+        ignored_names = ignore(src, names)
+    else:
+        ignored_names = set()
+
+    if not exists(dst):
+        _os.makedirs(dst)
+    errors = []
+    for name in names:
+        if name in ignored_names:
+            continue
+        srcname = _os.path.join(src, name)
+        dstname = _os.path.join(dst, name)
+        try:
+            if symlinks and _os.path.islink(srcname):
+                linkto = _os.readlink(srcname)
+                _os.symlink(linkto, dstname)
+            elif _os.path.isdir(srcname):
+                _copytree(srcname, dstname, symlinks, ignore)
+            else:
+                # Will raise a SpecialFileError for unsupported file types
+                _shutil.copy2(srcname, dstname)
+        # catch the Error from the recursive copytree so that we can
+        # continue with other files
+        except _shutil.Error as err:
+            errors.extend(err.args[0])
+        except EnvironmentError as why:
+            errors.append((srcname, dstname, str(why)))
+    try:
+        _shutil.copystat(src, dst)
+    except OSError as why:
+        if _shutil.WindowsError is not None and isinstance \
+               (why, _shutil.WindowsError):
+            # Copying file access times may fail on Windows
+            pass
+        else:
+            errors.append((src, dst, str(why)))
+    if errors:
+        raise _shutil.Error(errors)

Modified: qpid/site/scripts/gen-cpp-release-api-doc
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-cpp-release-api-doc?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-cpp-release-api-doc (original)
+++ qpid/site/scripts/gen-cpp-release-api-doc Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 def gen_messaging_api(release, source_dir, release_dir):
     component_dir = join(release_dir, "messaging-api")
@@ -82,8 +82,8 @@ def gen_ruby_messaging_api(release, sour
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release("cpp", release, checkout_dir)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release("cpp", source_release, checkout_dir)
 
 gen_messaging_api(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-cpp-release-books
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-cpp-release-books?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-cpp-release-books (original)
+++ qpid/site/scripts/gen-cpp-release-books Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 import uuid
 from xml.etree import ElementTree
@@ -84,8 +84,8 @@ def remove_namespace(doc, namespace):
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release("cpp", release, checkout_dir)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release("cpp", source_release, checkout_dir)
 
 gen_books(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-cpp-release-examples
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-cpp-release-examples?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-cpp-release-examples (original)
+++ qpid/site/scripts/gen-cpp-release-examples Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 ## Messaging API ##
 
@@ -119,8 +119,8 @@ def gen_ruby_messaging_api(release, sour
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release("cpp", release, checkout_dir)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release("cpp", source_release, checkout_dir)
 
 gen_messaging_api(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-cpp-release-notes
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-cpp-release-notes?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-cpp-release-notes (original)
+++ qpid/site/scripts/gen-cpp-release-notes Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 template = \
 """
@@ -53,22 +53,22 @@ documentation, see the [release overview
 {release_notes}
 """
 
-def gen_release_notes(release, release_dir):
+def gen_release_notes(release, issues_release, release_dir):
     output_path = join(release_dir, "release-notes.md")
 
-    release_notes = render_release_notes("qpid-cpp", release)
+    release_notes = render_release_notes("qpid-cpp", issues_release)
 
     output = template.format(**locals())
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "trunk":
     notice("Skipping generation for trunk")
-    sys.exit()
+    exit()
 
-gen_release_notes(release, release_dir)
+gen_release_notes(release, issues_release, release_dir)
 
 notice("Release notes generated")

Modified: qpid/site/scripts/gen-cpp-release-page
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-cpp-release-page?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-cpp-release-page (original)
+++ qpid/site/scripts/gen-cpp-release-page Wed Oct 28 14:46:29 2015
@@ -18,8 +18,9 @@
 # under the License.
 #
 
+from generate import *
+
 from datetime import datetime
-from qpid_site.generate import *
 
 source_artefact_records = (
     ("qpid-cpp-{}.tar.gz", "C++ broker, Qpid Messaging API (C++, bindings)"),
@@ -113,7 +114,7 @@ files you download.
 </script>
 """
 
-def gen_release_page(release, release_dir):
+def gen_release_page(release, issues_release, source_release, release_dir):
     output_path = join(release_dir, "index.md")
 
     components = list()
@@ -141,7 +142,7 @@ def gen_release_page(release, release_di
     source_artefacts = "\n".join(source_artefacts)
     components = "\n".join(components)
 
-    jql = "project = QPID AND fixVersion = 'qpid-cpp-{}' ORDER BY priority DESC".format(release)
+    jql = "project = QPID AND fixVersion = 'qpid-cpp-{}' ORDER BY priority DESC".format(issues_release)
     issues_url = "https://issues.apache.org/jira/issues/?jql={}".format(urllib.quote_plus(jql))
 
     vars = locals()
@@ -214,11 +215,11 @@ def gen_trunk_release_page(release_dir):
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "trunk":
     gen_trunk_release_page(release_dir)
 else:
-    gen_release_page(release, release_dir)
+    gen_release_page(release, issues_release, source_release, release_dir)
 
 notice("Release page generated")

Modified: qpid/site/scripts/gen-dispatch-release-api-doc
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-dispatch-release-api-doc?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-dispatch-release-api-doc (original)
+++ qpid/site/scripts/gen-dispatch-release-api-doc Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 def gen_dispatch_api_doc(release, source_dir, component_dir):
     include_dir = join(source_dir, "include")
@@ -33,8 +33,8 @@ def gen_dispatch_api_doc(release, source
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release_from_git("dispatch", release)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release_from_git("dispatch", source_release)
 
 gen_dispatch_api_doc(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-dispatch-release-books
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-dispatch-release-books?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-dispatch-release-books (original)
+++ qpid/site/scripts/gen-dispatch-release-books Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 def copy_html_to_in(from_dir, to_dir):
     html = list_dir(from_dir, "*.html")
@@ -27,7 +27,7 @@ def copy_html_to_in(from_dir, to_dir):
 
 def gen_books_and_man(release, source_dir, output_dir):
     build_dir = join(source_dir, "build")
-    make_dirs(build_dir)
+    make_dir(build_dir)
     with working_dir(build_dir):
         call("cmake ..")
         call("make")
@@ -38,8 +38,8 @@ def gen_books_and_man(release, source_di
     copy_html_to_in(join(build_dir, "doc", "html", "man"), join(output_dir, "man"))
 
 ## Now do stuff ##
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release_from_git("dispatch", release)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release_from_git("dispatch", source_release)
 
 gen_books_and_man(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-dispatch-release-notes
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-dispatch-release-notes?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-dispatch-release-notes (original)
+++ qpid/site/scripts/gen-dispatch-release-notes Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 template = \
 """
@@ -53,22 +53,22 @@ documentation, see the [release overview
 {release_notes}
 """
 
-def gen_release_notes(release, release_dir):
+def gen_release_notes(release, issues_release, release_dir):
     output_path = join(release_dir, "release-notes.md")
 
-    release_notes = render_release_notes("dispatch", release)
+    release_notes = render_release_notes("dispatch", issues_release)
 
     output = template.format(**locals())
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "master":
     notice("Skipping generation for master branch")
-    sys.exit()
+    exit()
 
-gen_release_notes(release, release_dir)
+gen_release_notes(release, issues_release, release_dir)
 
 notice("Release notes generated")

Modified: qpid/site/scripts/gen-dispatch-release-page
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-dispatch-release-page?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-dispatch-release-page (original)
+++ qpid/site/scripts/gen-dispatch-release-page Wed Oct 28 14:46:29 2015
@@ -18,8 +18,9 @@
 # under the License.
 #
 
+from generate import *
+
 from datetime import datetime
-from qpid_site.generate import *
 
 download_records = (
     ("qpid-dispatch-{}.tar.gz", "Dispatch router"),
@@ -33,7 +34,7 @@ documentation = \
 """
 <div class="two-column" markdown="1">
 
- - [Installing Qpid Dispatch](https://git-wip-us.apache.org/repos/asf?p=qpid-dispatch.git;a=blob_plain;f=README;hb={release})
+ - [Installing Qpid Dispatch](https://git-wip-us.apache.org/repos/asf?p=qpid-dispatch.git;a=blob_plain;f=README;hb={source_release})
  - [Dispatch router book](book/book.html)
  - [qdrouterd](man/qdrouterd.html) - Router daemon
  - [qdrouterd.conf](man/qdrouterd.conf.html) - Daemon configuration
@@ -102,7 +103,7 @@ the files you download.
 </script>
 """
 
-def gen_release_page(release, release_dir):
+def gen_release_page(release, issues_release, source_release, release_dir):
     output_path = join(release_dir, "index.md")
 
     downloads = list()
@@ -126,11 +127,11 @@ def gen_release_page(release, release_di
     downloads = "\n".join(downloads)
     components = "\n".join(components)
 
-    jql = "project = DISPATCH AND fixVersion = '{}' ORDER BY priority DESC".format(release)
+    jql = "project = DISPATCH AND fixVersion = '{}' ORDER BY priority DESC".format(issues_release)
     issues_url = "https://issues.apache.org/jira/issues/?jql={}".format(urllib.quote_plus(jql))
 
     vars = locals()
-    vars["documentation"] = documentation.format(release=release)
+    vars["documentation"] = documentation.format(release=release, source_release=source_release)
     
     output = template.format(**vars)
     output = output.strip()
@@ -190,18 +191,18 @@ def gen_master_release_page(release_dir)
     time = now.strftime("%H:%M %Z")
 
     vars = locals()
-    vars["documentation"] = documentation.format(release="master")
+    vars["documentation"] = documentation.format(release="master", source_release="master")
     
     output = master_template.format(**vars)
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "master":
     gen_master_release_page(release_dir)
 else:
-    gen_release_page(release, release_dir)
+    gen_release_page(release, issues_release, source_release, release_dir)
 
 notice("Release page generated")

Modified: qpid/site/scripts/gen-java-release-books
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-java-release-books?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-java-release-books (original)
+++ qpid/site/scripts/gen-java-release-books Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 import uuid
 from xml.etree import ElementTree
@@ -97,8 +97,8 @@ def remove_namespace(doc, namespace):
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release("java", release, checkout_dir)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release("java", source_release, checkout_dir)
 
 gen_books(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-java-release-examples
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-java-release-examples?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-java-release-examples (original)
+++ qpid/site/scripts/gen-java-release-examples Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 ## JMS ##
 
@@ -55,8 +55,8 @@ def gen_jms(release, source_dir, release
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release("java", release, checkout_dir)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release("java", source_release, checkout_dir)
 
 gen_jms(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-java-release-notes
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-java-release-notes?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-java-release-notes (original)
+++ qpid/site/scripts/gen-java-release-notes Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 template = \
 """
@@ -53,22 +53,22 @@ documentation, see the [release overview
 {release_notes}
 """
 
-def gen_release_notes(release, release_dir):
+def gen_release_notes(release, issues_release, release_dir):
     output_path = join(release_dir, "release-notes.md")
 
-    release_notes = render_release_notes("java", release)
+    release_notes = render_release_notes("qpid-java", issues_release)
 
     output = template.format(**locals())
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "trunk":
     notice("Skipping generation for trunk")
-    sys.exit()
+    exit()
 
-gen_release_notes(release, release_dir)
+gen_release_notes(release, issues_release, release_dir)
 
 notice("Release notes generated")

Modified: qpid/site/scripts/gen-java-release-page
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-java-release-page?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-java-release-page (original)
+++ qpid/site/scripts/gen-java-release-page Wed Oct 28 14:46:29 2015
@@ -18,8 +18,9 @@
 # under the License.
 #
 
+from generate import *
+
 from datetime import datetime
-from qpid_site.generate import *
 
 source_artefact_records = (
     ("qpid-java-{}.tar.gz", "Java broker, Qpid JMS, Qpid JCA"),
@@ -127,7 +128,7 @@ files you download.
 </script>
 """
 
-def gen_release_page(release, release_dir):
+def gen_release_page(release, issues_release, source_release, release_dir):
     output_path = join(release_dir, "index.md")
 
     components = list()
@@ -171,7 +172,7 @@ def gen_release_page(release, release_di
     binary_artefacts = "\n".join(binary_artefacts)
     components = "\n".join(components)
 
-    jql = "project = QPID AND fixVersion = 'qpid-java-{}' ORDER BY priority DESC".format(release)
+    jql = "project = QPID AND fixVersion = '{}' ORDER BY priority DESC".format(issues_release)
     issues_url = "https://issues.apache.org/jira/issues/?jql={}".format(urllib.quote_plus(jql))
 
     vars = locals()
@@ -244,11 +245,11 @@ def gen_trunk_release_page(release_dir):
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "trunk":
     gen_trunk_release_page(release_dir)
 else:
-    gen_release_page(release, release_dir)
+    gen_release_page(release, issues_release, source_release, release_dir)
 
 notice("Release page generated")

Modified: qpid/site/scripts/gen-jms-release-docs
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-jms-release-docs?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-jms-release-docs (original)
+++ qpid/site/scripts/gen-jms-release-docs Wed Oct 28 14:46:29 2015
@@ -18,11 +18,10 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 def gen_docs(release, source_dir, output_dir):
     docs_input_dir = join(source_dir, "qpid-jms-docs")
-
     docs_output_dir = join(output_dir, "docs")
 
     remove(docs_output_dir)
@@ -33,8 +32,8 @@ def gen_docs(release, source_dir, output
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release_from_git("jms", release)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release_from_git("jms", source_release)
 
 gen_docs(release, source_dir, release_dir)
 

Modified: qpid/site/scripts/gen-jms-release-notes
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-jms-release-notes?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-jms-release-notes (original)
+++ qpid/site/scripts/gen-jms-release-notes Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 template = \
 """
@@ -55,22 +55,22 @@ documentation, see the [release overview
 {release_notes}
 """
 
-def gen_release_notes(release, release_dir):
+def gen_release_notes(release, issues_release, release_dir):
     output_path = join(release_dir, "release-notes.md")
 
-    release_notes = render_release_notes("qpidjms", release)
+    release_notes = render_release_notes("qpidjms", issues_release)
 
     output = template.format(**locals())
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
-if release == "trunk":
-    notice("Skipping generation for trunk")
-    sys.exit()
+if release == "master":
+    notice("Skipping generation for master")
+    exit()
 
-gen_release_notes(release, release_dir)
+gen_release_notes(release, issues_release, release_dir)
 
 notice("Release notes generated")

Modified: qpid/site/scripts/gen-jms-release-page
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-jms-release-page?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-jms-release-page (original)
+++ qpid/site/scripts/gen-jms-release-page Wed Oct 28 14:46:29 2015
@@ -18,8 +18,9 @@
 # under the License.
 #
 
+from generate import *
+
 from datetime import datetime
-from qpid_site.generate import *
 
 download_records = (
     ("apache-qpid-jms-{}-bin.tar.gz", "Qpid JMS binaries"),
@@ -31,7 +32,7 @@ documentation = \
 <div class="two-column" markdown="1">
 
  - [API reference](http://docs.oracle.com/javaee/1.4/api/javax/jms/package-summary.html)
- - [Examples](https://github.com/apache/qpid-jms/tree/{release}/qpid-jms-examples)
+ - [Examples](https://github.com/apache/qpid-jms/tree/{source_release}/qpid-jms-examples)
  - [Configuration](docs/index.html)
  - [Building Qpid JMS](building.html)
 
@@ -89,7 +90,7 @@ The client is also available [via Maven]
 
  - [All release artefacts](http://archive.apache.org/dist/qpid/jms/{release})
  - [Resolved issues in JIRA]({issues_url})
- - [Source repository tag](https://git-wip-us.apache.org/repos/asf/qpid-jms.git/tree/refs/tags/{release})
+ - [Source repository tag](https://git-wip-us.apache.org/repos/asf/qpid-jms.git/tree/refs/tags/{source_release})
 
 <script type="text/javascript">
   _deferredFunctions.push(function() {{
@@ -100,7 +101,7 @@ The client is also available [via Maven]
 </script>
 """
 
-def gen_release_page(release, release_dir):
+def gen_release_page(release, issues_release, source_release, release_dir):
     output_path = join(release_dir, "index.md")
 
     downloads = list()
@@ -124,7 +125,7 @@ def gen_release_page(release, release_di
     issues_url = "https://issues.apache.org/jira/issues/?jql={}".format(urllib.quote_plus(jql))
 
     vars = locals()
-    vars["documentation"] = documentation.format(release=release)
+    vars["documentation"] = documentation.format(release=release, source_release=source_release)
 
     output = template.format(**vars)
     output = output.strip()
@@ -186,18 +187,18 @@ def gen_master_release_page(release_dir)
     
     
     vars = locals()
-    vars["documentation"] = documentation.format(release="master")
+    vars["documentation"] = documentation.format(release="master", source_release="master")
 
     output = master_template.format(**vars)
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "master":
     gen_master_release_page(release_dir)
 else:
-    gen_release_page(release, release_dir)
+    gen_release_page(release, issues_release, source_release, release_dir)
 
 notice("Release page generated")

Modified: qpid/site/scripts/gen-proton-release-api-doc
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-proton-release-api-doc?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-proton-release-api-doc (original)
+++ qpid/site/scripts/gen-proton-release-api-doc Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 # API docs
 
@@ -99,8 +99,8 @@ def gen_book(release, source_dir, releas
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release_from_git("proton", release)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release_from_git("proton", source_release)
 
 gen_api_doc(release, source_dir, release_dir)
 gen_book(release, source_dir, release_dir)

Modified: qpid/site/scripts/gen-proton-release-examples
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-proton-release-examples?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-proton-release-examples (original)
+++ qpid/site/scripts/gen-proton-release-examples Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 ## Engine/Reactor ##
 
@@ -147,8 +147,8 @@ def gen_ruby_messenger(release, source_d
 
 ## Now do stuff ##
 
-release, release_dir, checkout_dir = setup_release_script()
-source_dir = export_release_from_git("proton", release)
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
+source_dir = export_release_from_git("proton", source_release)
 
 gen_engine(release, source_dir, release_dir)
 gen_messenger(release, source_dir, release_dir)

Modified: qpid/site/scripts/gen-proton-release-notes
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-proton-release-notes?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-proton-release-notes (original)
+++ qpid/site/scripts/gen-proton-release-notes Wed Oct 28 14:46:29 2015
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-from qpid_site.generate import *
+from generate import *
 
 template = \
 """
@@ -52,22 +52,22 @@ documentation, see the [release overview
 {release_notes}
 """
 
-def gen_release_notes(release, release_dir):
+def gen_release_notes(release, issues_release, release_dir):
     output_path = join(release_dir, "release-notes.md")
 
-    release_notes = render_release_notes("proton", release)
+    release_notes = render_release_notes("proton", issues_release)
 
     output = template.format(**locals())
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "master":
     notice("Skipping generation for master")
-    sys.exit()
+    exit()
 
-gen_release_notes(release, release_dir)
+gen_release_notes(release, issues_release, release_dir)
 
 notice("Release notes generated")

Modified: qpid/site/scripts/gen-proton-release-page
URL: http://svn.apache.org/viewvc/qpid/site/scripts/gen-proton-release-page?rev=1711024&r1=1711023&r2=1711024&view=diff
==============================================================================
--- qpid/site/scripts/gen-proton-release-page (original)
+++ qpid/site/scripts/gen-proton-release-page Wed Oct 28 14:46:29 2015
@@ -18,8 +18,9 @@
 # under the License.
 #
 
+from generate import *
+
 from datetime import datetime
-from qpid_site.generate import *
 
 download_records = (
     ("qpid-proton-{}.tar.gz", "Qpid Proton"),
@@ -35,8 +36,8 @@ documentation = \
  - [Python API reference](proton/python/api/index.html)
  - [Python tutorial](proton/python/book/tutorial.html)
  - [Python examples](proton/python/examples/index.html)
- - [Go binding](https://github.com/apache/qpid-proton/tree/master/proton-c/bindings/go/README.md)
- - [Installing Qpid Proton](https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=blob;f=INSTALL.md;hb={release})
+;; - [Go binding](https://github.com/apache/qpid-proton/tree/master/proton-c/bindings/go/README.md)
+ - [Installing Qpid Proton](https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=blob;f=INSTALL.md;hb={source_release})
 
 </div>
 """
@@ -88,7 +89,7 @@ the files you download.
 
  - [All release artefacts](http://archive.apache.org/dist/qpid/proton/{release})
  - [Resolved issues in JIRA]({issues_url})
- - [Source repository branch](https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=tree;hb={release})
+ - [Source repository branch](https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=tree;hb={source_release})
  - [Source repository tag](https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=tag;h={release})
 
 <script type="text/javascript">
@@ -100,7 +101,7 @@ the files you download.
 </script>
 """
 
-def gen_release_page(release, release_dir):
+def gen_release_page(release, issues_release, source_release, release_dir):
     output_path = join(release_dir, "index.md")
 
     downloads = list()
@@ -111,18 +112,18 @@ def gen_release_page(release, release_di
         artifact_url = artifact_url_template.format(release, artifact)
         asc_url = "{}.asc".format(artifact_url)
         md5_url = "{}.md5".format(artifact_url)
-        sha1_url = "{}.sha".format(artifact_url)
+        sha1_url = "{}.sha1".format(artifact_url)
 
         args = summary, artifact, artifact_url, asc_url, md5_url, sha1_url
         downloads.append("| {} | [{}]({}) | [ASC]({}), [MD5]({}), [SHA1]({}) |".format(*args))
 
     downloads = "\n".join(downloads)
 
-    jql = "project = PROTON AND fixVersion = '{}' ORDER BY priority DESC".format(release)
+    jql = "project = PROTON AND fixVersion = '{}' ORDER BY priority DESC".format(issues_release)
     issues_url = "https://issues.apache.org/jira/issues/?jql={}".format(urllib.quote_plus(jql))
 
     vars = locals()
-    vars["documentation"] = documentation.format(release=release)
+    vars["documentation"] = documentation.format(release=release, source_release=source_release)
     
     output = template.format(**vars)
     output = output.strip()
@@ -182,18 +183,18 @@ def gen_master_release_page(release_dir)
     time = now.strftime("%H:%M %Z")
 
     vars = locals()
-    vars["documentation"] = documentation.format(release="master")
+    vars["documentation"] = documentation.format(release="master", source_release="master")
     
     output = master_template.format(**vars)
     output = output.strip()
 
     write(output_path, output)
 
-release, release_dir, checkout_dir = setup_release_script()
+release, issues_release, source_release, release_dir, checkout_dir = setup_release_script()
 
 if release == "master":
     gen_master_release_page(release_dir)
 else:
-    gen_release_page(release, release_dir)
+    gen_release_page(release, issues_release, source_release, release_dir)
 
 notice("Release page generated")



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message