summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-11-19 13:00:55 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-11-19 13:03:02 +0000
commit4d21b5f58a8ce6f5ec4685ec298548c9b83ba37b (patch)
tree5dd58251900950eeb6bc5bcf1ffd49dd92b4208a /tools
parentdf17fb16b8c26b255ca6fad5a2f6010520b7a7bd (diff)
Update telepathy.am from tp-glib and add make-release-mail.py
Also only ship the changelog since 5.4, which should be plenty. Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/make-release-mail.py76
-rw-r--r--tools/telepathy.am48
2 files changed, 119 insertions, 5 deletions
diff --git a/tools/make-release-mail.py b/tools/make-release-mail.py
new file mode 100644
index 00000000..2bd7c2bc
--- /dev/null
+++ b/tools/make-release-mail.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# vim: set fileencoding=utf-8 :
+#
+# Hello. This is make-release-mail.py from the Telepathy project. It's
+# designed to turn an item from a NEWS file into a mail suitable for sending
+# to <telepathy@lists.freedesktop.org>. I hope that you enjoy your stay.
+
+import sys
+
+def extract_description(package, version, news_path):
+ release_name = []
+ details = []
+
+ with open(news_path) as f:
+ lines = (line for line in f.readlines())
+ for line in lines:
+ # Find the 'telepathy-foo 0.1.2' header
+ if line.startswith("%s %s" % (package, version)):
+ break
+
+ # Skip the ====== line, and the first blank line
+ lines.next()
+ lines.next()
+
+ got_release_name = False
+
+ for line in lines:
+ line = line.rstrip()
+ # If we hit the next version header, we're done
+ if line.startswith(package):
+ break
+ # Else, if we hit a blank line and we're still reading the release
+ # name, we're done with the release name.
+ elif not got_release_name and line == '':
+ got_release_name = True
+ # Otherwise, append this to the relevant list
+ elif not got_release_name:
+ release_name.append(line)
+ else:
+ details.append(line)
+
+ assert got_release_name, (release_name, details)
+
+ # We rstrip details because it picks up a trailing blank line
+ return ('\n'.join(release_name), '\n'.join(details).rstrip())
+
+BASE_URL = 'http://telepathy.freedesktop.org/releases'
+
+def main(package, version, news_path):
+ release_name, details = extract_description(package, version, news_path)
+
+ print """
+%(release_name)s
+
+tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz
+signature: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz.asc
+
+%(details)s""".strip().rstrip() % {
+ 'base_url': BASE_URL,
+ 'package': package,
+ 'version': version,
+ 'release_name': release_name,
+ 'details': details,
+ }
+
+if __name__ == '__main__':
+ try:
+ package, version, news_path = sys.argv[1:]
+
+ main(package, version, news_path)
+ except ValueError, e:
+ sys.stderr.write(
+ 'Usage: %s package-name package.version.number path/to/NEWS\n' %
+ sys.argv[0])
+ sys.stderr.flush()
+ sys.exit(1)
diff --git a/tools/telepathy.am b/tools/telepathy.am
index 8b99931e..45baa772 100644
--- a/tools/telepathy.am
+++ b/tools/telepathy.am
@@ -3,19 +3,51 @@
dist-hook:
chmod u+w ${distdir}/ChangeLog
if test -d ${top_srcdir}/.git; then \
- git log --stat > ${distdir}/ChangeLog || \
- git log > ${distdir}/ChangeLog; \
+ git log --date=iso $(CHANGELOG_RANGE) > ${distdir}/ChangeLog; \
fi
-maintainer-upload-release: _maintainer-upload-release
+distcheck-hook:
+ @test "z$(CHECK_FOR_UNRELEASED)" = z || \
+ case @VERSION@ in \
+ *.*.*.*|*+) ;; \
+ *) \
+ if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \
+ then \
+ echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \
+ exit 2; \
+ fi \
+ ;; \
+ esac
-_maintainer-upload-release-check:
+_is-release-check:
@case @VERSION@ in \
(*.*.*.*|*+) \
- echo "@VERSION@ is not a release" >&2; \
+ echo "Hey! @VERSION@ is not a release!" >&2; \
exit 2; \
;; \
esac
+ @if ! git diff --no-ext-diff --quiet --exit-code; then \
+ echo "Hey! Your tree is dirty! No release for you." >&2; \
+ exit 2; \
+ fi
+
+%.tar.gz.asc: %.tar.gz
+ $(AM_V_GEN)gpg --detach-sign --armor $@
+
+@PACKAGE@-@VERSION@.tar.gz: _is-release-check check distcheck
+
+maintainer-prepare-release: _is-release-check check distcheck release-mail
+ git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@
+ gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz
+
+release-mail: NEWS
+ $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \
+ @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \
+ mv $@.tmp $@)
+
+maintainer-upload-release: _maintainer-upload-release
+
+_maintainer-upload-release-check: _is-release-check
test -f @PACKAGE@-@VERSION@.tar.gz
test -f @PACKAGE@-@VERSION@.tar.gz.asc
gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc
@@ -24,4 +56,10 @@ _maintainer-upload-release: _maintainer-upload-release-check
rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz
rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc
+maintainer-make-release: maintainer-prepare-release maintainer-upload-release
+ @echo "Now:"
+ @echo " • bump the nano-version;"
+ @echo " • push the branch and tags upstream; and"
+ @echo " • send release-mail to <telepathy@lists.freedesktop.org>."
+
## vim:set ft=automake: