aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKamal Mostafa <kamal@whence.com>2014-08-19 17:14:47 +0200
committerGuido Günther <agx@sigxcpu.org>2014-08-19 17:15:54 +0200
commit6823e519deaf2a37a3d6225cd0392954c423b569 (patch)
tree1e23240dfd9278f7c169a3eaeb1c3f3e9736292c
parentc3258c19c6cfa291c8bebac1dae230f6e3ccca36 (diff)
buildpackage: Make debian-tag message configurable
New config option --git-debian-tag-msg allows for the specification of the message format string for signed debian-tags. When left unset, the default debian-tag-msg format is still: %(pkg)s Debian release %(version)s Signed-off-by: Kamal Mostafa <kamal@whence.com>
-rw-r--r--docs/manpages/gbp-buildpackage.sgml13
-rw-r--r--gbp.conf1
-rw-r--r--gbp/config.py4
-rwxr-xr-xgbp/scripts/buildpackage.py7
4 files changed, 21 insertions, 4 deletions
diff --git a/docs/manpages/gbp-buildpackage.sgml b/docs/manpages/gbp-buildpackage.sgml
index d0d68bc6..42e6fc78 100644
--- a/docs/manpages/gbp-buildpackage.sgml
+++ b/docs/manpages/gbp-buildpackage.sgml
@@ -44,8 +44,9 @@
<arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg>
<arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg>
<arg><option>--git-[no-]hooks</option></arg>
- <arg><option>--git-debian-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--git-debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--git-upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg>
<arg><option>--git-force-create</option></arg>
<arg><option>--git-no-create-orig</option></arg>
<arg><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg>
@@ -431,6 +432,14 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>
+ </term>
+ <listitem>
+ <para>use this tag message format when signing Debian versions,
+ default is <replaceable>%(pkg)s Debian release %(version)s</replaceable></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--git-force-create</option>
</term>
<listitem>
diff --git a/gbp.conf b/gbp.conf
index aa9c35f8..435d9b0a 100644
--- a/gbp.conf
+++ b/gbp.conf
@@ -12,6 +12,7 @@
# the default tag formats used:
#upstream-tag = upstream/%(version)s
#debian-tag = debian/%(version)s
+#debian-tag-msg = %(pkg)s Debian release %(version)s
# use pristine-tar:
#pristine-tar = True
# don't check if debian-branch == current branch:
diff --git a/gbp/config.py b/gbp/config.py
index af21fb8a..e0cd779a 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -106,6 +106,7 @@ class GbpOptionParser(OptionParser):
'postimport' : '',
'hooks' : 'True',
'debian-tag' : 'debian/%(version)s',
+ 'debian-tag-msg' : '%(pkg)s Debian release %(version)s',
'upstream-tag' : 'upstream/%(version)s',
'import-msg' : 'Imported Upstream version %(version)s',
'commit-msg' : 'Update changelog for %(version)s release',
@@ -167,6 +168,9 @@ class GbpOptionParser(OptionParser):
'debian-tag':
("Format string for debian tags, "
"default is '%(debian-tag)s'"),
+ 'debian-tag-msg':
+ ("Format string for signed debian-tag messages, "
+ "default is '%(debian-tag-msg)s'"),
'upstream-tag':
("Format string for upstream tags, "
"default is '%(upstream-tag)s'"),
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 457673c9..86cf2703 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -402,6 +402,7 @@ def build_parser(name, prefix=None):
tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
tag_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
+ tag_group.add_config_file_option(option_name="debian-tag-msg", dest="debian_tag_msg")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
@@ -602,9 +603,11 @@ def main(argv):
gbp.log.info("Tagging %s as %s" % (source.changelog.version, tag))
if options.retag and repo.has_tag(tag):
repo.delete_tag(tag)
+ tag_msg=options.debian_tag_msg % dict(
+ pkg=source.sourcepkg,
+ version=source.changelog.version)
repo.create_tag(name=tag,
- msg="%s Debian release %s" % (source.sourcepkg,
- source.changelog.version),
+ msg=tag_msg,
sign=options.sign_tags, keyid=options.keyid)
if options.posttag:
sha = repo.rev_parse("%s^{}" % tag)