From: Guido Günther Date: Sun, 10 Aug 2014 23:00:05 +0000 (+0200) Subject: Make sure we fixup the changelog trailer with newer devscripts X-Git-Tag: debian/0.6.17~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=692e5da2efa8f691a75200cf16df06112ffad435;p=tools%2Fgit-buildpackage.git 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 --- diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index c034480..20a7b1b 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):