UBUNTU: [Packaging] git-ubuntu-log -- fix order of tracking bug commit

The package tracking bug number is not inserted anymore on the changelog
by the link-to-tracker script. Instead, it creates/updates the
debian.<branch>/tracking-bug file and commits the change.

We want this commit to be added to the changelog in a similar fashion as
before, as the first entry. So change the git-ubuntu-log script to
detect that commit and insert it in the right place.

Ignore: yes
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 19d80223
...@@ -28,13 +28,19 @@ def add_entry(entry): ...@@ -28,13 +28,19 @@ def add_entry(entry):
else: else:
combo = '__mainline__' combo = '__mainline__'
else: else:
if combo not in keys: if entry.get('subject', "") == 'UBUNTU: link-to-tracker: update tracking bug':
keys.append(combo) # Construct a key with '__trackingbug__' on the first position
# and the tracking bug number afterwards
combo.insert(0, '__trackingbug__')
# Tracking bug goes at the top
keys.insert(0, combo)
else:
if combo not in keys:
keys.append(combo)
entry['key'] = combo entry['key'] = combo
entries.append(entry) entries.append(entry)
# Suck up the git log output and extract the information we need. # Suck up the git log output and extract the information we need.
keys = [] keys = []
entry = None entry = None
...@@ -90,6 +96,10 @@ for key in keys: ...@@ -90,6 +96,10 @@ for key in keys:
for bug in key: for bug in key:
if bug.startswith('CVE-'): if bug.startswith('CVE-'):
title_set.append(bug) title_set.append(bug)
elif bug == '__trackingbug__':
# Look for the tracking bug number on the second
# position of the key
continue
else: else:
bug_info = None bug_info = None
...@@ -132,8 +142,9 @@ for key in keys: ...@@ -132,8 +142,9 @@ for key in keys:
emit_title = False emit_title = False
title_lines = textwrap.wrap(entry['subject'], 76) if key[0] != '__trackingbug__':
print(' - ' + title_lines[0]) title_lines = textwrap.wrap(entry['subject'], 76)
for line in title_lines[1:]: print(' - ' + title_lines[0])
line = line.replace('LP###', 'LP: #') for line in title_lines[1:]:
print(' ' + line) line = line.replace('LP###', 'LP: #')
print(' ' + line)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment