UBUNTU: [Packaging] resync git-ubuntu-log

BugLink: https://bugs.launchpad.net/bugs/1786013
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
This commit is contained in:
Manuel Diewald
2024-11-30 19:17:26 +01:00
parent 42cd40267d
commit 2e00a6fe44
+12 -13
View File
@@ -15,6 +15,8 @@ entries = []
def add_entry(entry):
global tracking_bug
if entry and 'ignore' not in entry:
combo = []
for bug in set(entry.get('bugs', [])):
@@ -30,14 +32,9 @@ def add_entry(entry):
combo = '__mainline__'
else:
if entry.get('subject', "") == 'UBUNTU: link-to-tracker: update tracking bug':
# 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)
tracking_bug = combo
if combo not in keys:
keys.append(combo)
entry['key'] = combo
entries.append(entry)
@@ -45,6 +42,7 @@ def add_entry(entry):
# Suck up the git log output and extract the information we need.
keys = []
tracking_bug = None
entry = None
subject_wait = False
for line in sys.stdin:
@@ -98,6 +96,11 @@ for entry in entries:
keys.append('__packaging__')
keys.append('__mainline__')
# Ensure we list the tracking bug updates first.
if tracking_bug is not None:
keys.remove(tracking_bug)
keys.insert(0, tracking_bug)
emit_nl = False
for key in keys:
if key == '__packaging__':
@@ -109,10 +112,6 @@ for key in keys:
for bug in key:
if bug.startswith('CVE-'):
title_set.append(bug)
elif bug == '__trackingbug__':
# Look for the tracking bug number on the second
# position of the key
continue
elif bug.isdigit():
# Assume that it is an LP bug number if 'bug' contains only digits
bug_info = None
@@ -158,7 +157,7 @@ for key in keys:
emit_title = False
if key[0] != '__trackingbug__':
if key != tracking_bug or (key == tracking_bug and entry['subject'] != "link-to-tracker: update tracking bug"):
title_lines = textwrap.wrap(entry['subject'], 76)
print(' - ' + title_lines[0])
for line in title_lines[1:]: