diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-08-11 01:00:05 +0200 |
---|---|---|
committer | Bla Fasel <agx@sigxcpu.org> | 2014-08-11 01:08:12 +0200 |
commit | 692e5da2efa8f691a75200cf16df06112ffad435 (patch) | |
tree | c9620720c4d509e0cd6cd7d43d1f39b5fef272ea | |
parent | b305116a285ae4028e6028297e2c1c9c6c60dded (diff) |
Make sure we fixup the changelog trailer with newer devscripts
We don't change any mainttrailer options if already given.
Thanks: James McCoy for the detailed explanation
Closes: #740566
-rw-r--r-- | gbp/scripts/dch.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index c0344805..20a7b1b5 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -70,11 +70,13 @@ def fixup_section(repo, git_author, options, dch_options): It might otherwise point to the last git committer instead of the person creating the changelog - This apply --distribution and --urgency options passed to git-dch + + This also applies --distribution and --urgency options passed to gbp dch """ author, email = get_author_email(repo, git_author) used_options = ['distribution', 'urgency'] - header_opts = [] + opts = [] + maintrailer_opts = [ '--nomainttrailer', '--mainttrailer', '-t' ] # This must not be done for snapshots or snapshots changelog entries # will not be concatenated @@ -83,11 +85,16 @@ def fixup_section(repo, git_author, options, dch_options): val = getattr(options, opt) if val: gbp.log.debug("Set header option '%s' to '%s'" % (opt, val)) - header_opts.append("--%s=%s" % (opt, val)) + opts.append("--%s=%s" % (opt, val)) else: gbp.log.debug("Snapshot enabled: do not fixup options in header") - ChangeLog.spawn_dch(msg='', author=author, email=email, dch_options=dch_options+header_opts) + for opt in mainttrailer_opts: + if opt in dch_options: + break + else: + opts.append(maintrailer_opts[0]) + ChangeLog.spawn_dch(msg='', author=author, email=email, dch_options=dch_options+opts) def snapshot_version(version): |