buildpackage: Make debian-tag message configurable
authorKamal Mostafa <kamal@whence.com>
Tue, 19 Aug 2014 15:14:47 +0000 (17:14 +0200)
committerGuido Günther <agx@sigxcpu.org>
Tue, 19 Aug 2014 15:15:54 +0000 (17:15 +0200)
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>
docs/manpages/gbp-buildpackage.sgml
gbp.conf
gbp/config.py
gbp/scripts/buildpackage.py

index d0d68bc..42e6fc7 100644 (file)
@@ -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>
         </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>
index aa9c35f..435d9b0 100644 (file)
--- 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:
index af21fb8..e0cd779 100644 (file)
@@ -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'"),
index 457673c..86cf270 100755 (executable)
@@ -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)