summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-01-04 11:36:36 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-01-04 12:15:20 +0000
commit764b9675887917a6f430b2ae9186714aa689bc65 (patch)
treef6ee933f99500415f9022f59331e7ecbd6012c7c /tools
parent53fccdad96d7d2ace910b2f80ba7048046fc94bf (diff)
downloadtelepathy-salut-764b9675887917a6f430b2ae9186714aa689bc65.tar.gz
Update make-release-mail from telepathy-glib master
Diffstat (limited to 'tools')
-rw-r--r--tools/make-release-mail.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/make-release-mail.py b/tools/make-release-mail.py
index 5c42b479..b03ebd25 100644
--- a/tools/make-release-mail.py
+++ b/tools/make-release-mail.py
@@ -6,6 +6,15 @@
# to <telepathy@lists.freedesktop.org>. I hope that you enjoy your stay.
import sys
+import re
+
+def looks_like_a_header(line, package, version=None):
+ if version is None:
+ pattern = "^%s .* \(.*\)$" % package
+ else:
+ pattern = "^%s %s \(.*\)$" % (package, version)
+
+ return re.match(pattern, line) is not None
def extract_description(package, version, news_path):
release_name = []
@@ -15,7 +24,7 @@ def extract_description(package, version, news_path):
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)):
+ if looks_like_a_header(line, package, version):
break
# Skip the ====== line, and the first blank line
@@ -27,7 +36,7 @@ def extract_description(package, version, news_path):
for line in lines:
line = line.rstrip()
# If we hit the next version header, we're done
- if line.startswith(package):
+ if looks_like_a_header(line, package):
break
# Else, if we hit a blank line and we're still reading the release
# name, we're done with the release name.