aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-07-25 16:04:02 +0000
committerlloyd <[email protected]>2012-07-25 16:04:02 +0000
commit84c31975154e805c6a2ac75a79b550e5cac9ddb3 (patch)
tree71d84cd8a0fd992d506d06d2c231bf9f73d40f14
parentcfc78ac532e94d64a02b39b93d69fc1b2cf558ec (diff)
Have the release script pull the datestamp from monotone, so it does
not need to be manually set before a release.
-rw-r--r--botan_version.py8
-rw-r--r--doc/release_process.rst18
-rwxr-xr-xsrc/build-data/scripts/dist.py51
3 files changed, 60 insertions, 17 deletions
diff --git a/botan_version.py b/botan_version.py
index ef75fd5f8..8fb0723db 100644
--- a/botan_version.py
+++ b/botan_version.py
@@ -1,9 +1,9 @@
release_major = 1
release_minor = 11
-release_patch = 0
-
-release_vc_rev = None
+release_patch = 1
release_so_abi_rev = 0
-release_datestamp = 20120719
+# These are set by the distribution script
+release_vc_rev = None
+release_datestamp = 0
diff --git a/doc/release_process.rst b/doc/release_process.rst
index 7562ec53f..5419ab468 100644
--- a/doc/release_process.rst
+++ b/doc/release_process.rst
@@ -10,13 +10,13 @@ Pre Release Checks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Confirm that the release notes under ``doc/relnotes`` are accurate and
-complete. Then update the datestamp in the release notes and in
-``readme.txt`` and ``botan_version.py`` (also checking that the
-version is correct in those files), and change the entry for the
-appropriate branch in ``doc/download.rst`` to point to the new
-release. Check in these changes (alone, with no other modifications)
-with a checkin message along the lines of "Update for X.Y.Z release",
-then tag the release with the version in monotone (eg tag '1.11.8', no
+complete, updating the datestamp in the release notes and in
+``readme.txt``. Additionally confirm the version number in
+``botan_version.py`` is correct. Change the entry for the appropriate branch in ``doc/download.rst`` to point to the new release.
+
+Check in these changes (alone, with no other modifications) with a
+checkin message along the lines of "Update for X.Y.Z release", then
+tag the release with the version in monotone (eg tag '1.11.8', no
prefix).
Build The Release
@@ -86,5 +86,5 @@ Post Release Process
Immediately after the new release is created, update
``botan_version.py`` and ``readme.txt`` once again, incrementing the
version number as appropriate and removing the release dates. For
-release notes, use "Not Yet Released" as the placeholder. For
-``botan_version.py``, use 0.
+release notes, use "Not Yet Released" as the placeholder.
+
diff --git a/src/build-data/scripts/dist.py b/src/build-data/scripts/dist.py
index 8a81f17fe..b32edd73f 100755
--- a/src/build-data/scripts/dist.py
+++ b/src/build-data/scripts/dist.py
@@ -8,14 +8,16 @@ Release script for botan (http://botan.randombit.net/)
Distributed under the terms of the Botan license
"""
-import optparse
-import subprocess
+import errno
import logging
+import optparse
import os
-import sys
+import shlex
+import StringIO
import shutil
+import subprocess
+import sys
import tarfile
-import errno
def check_subprocess_results(subproc, name):
(stdout, stderr) = subproc.communicate()
@@ -42,6 +44,45 @@ def run_monotone(db, args):
return check_subprocess_results(mtn, 'mtn')
+def get_certs(db, rev_id):
+ tokens = shlex.split(run_monotone(db, ['automate', 'certs', rev_id]))
+
+ def usable_cert(cert):
+ if 'signature' not in cert or cert['signature'] != 'ok':
+ return False
+ if 'trust' not in cert or cert['trust'] != 'trusted':
+ return False
+ if 'name' not in cert or 'value' not in cert:
+ return False
+ return True
+
+ def cert_builder(tokens):
+ pairs = zip(tokens[::2], tokens[1::2])
+ current_cert = {}
+ for pair in pairs:
+ if pair[0] == 'key':
+ if usable_cert(current_cert):
+ name = current_cert['name']
+ value = current_cert['value']
+ current_cert = {}
+
+ logging.debug('Cert %s "%s" for rev %s' % (name, value, rev_id))
+ yield (name, value)
+
+ current_cert[pair[0]] = pair[1]
+
+ certs = dict(cert_builder(tokens))
+ return certs
+
+def datestamp(db, rev_id):
+ certs = get_certs(db, rev_id)
+
+ if 'date' in certs:
+ return int(certs['date'].replace('-','')[0:8])
+
+ logging.info('Could not retreive date for %s' % (rev_id))
+ return 0
+
def gpg_sign(file, keyid):
logging.info('Signing %s using PGP id %s' % (file, keyid))
@@ -141,6 +182,8 @@ def main(args = None):
for line in contents:
if line == 'release_vc_rev = None\n':
yield 'release_vc_rev = \'mtn:%s\'\n' % (rev_id)
+ elif line == 'release_datestamp = 0\n':
+ yield 'release_vc_rev = %d\n' % (datestamp(rev_iv))
else:
yield line