diff --git a/debian/scripts/misc/git-ubuntu-log b/debian/scripts/misc/git-ubuntu-log index 8efdb404b561..6bb1d2af545b 100755 --- a/debian/scripts/misc/git-ubuntu-log +++ b/debian/scripts/misc/git-ubuntu-log @@ -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:]: