]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/misc/git-ubuntu-log
490ecce73c484e098c2b3bf7ea8875ab28f09e9f
12 sys
.stdin
= codecs
.getreader("utf-8")(sys
.stdin
.detach())
13 sys
.stdout
= codecs
.getwriter("utf-8")(sys
.stdout
.detach())
17 if entry
and 'ignore' not in entry
:
19 for bug
in entry
.get('bugs', []):
21 for cve
in entry
.get('cves', []):
26 if entry
.get('subject', "").startswith('UBUNTU'):
27 combo
= '__packaging__'
29 combo
= '__mainline__'
38 # Suck up the git log output and extract the information we need.
42 for line
in sys
.stdin
:
43 if line
.startswith('commit '):
48 elif line
.startswith('Author: '):
49 bits
= line
.strip().split(maxsplit
=1)
50 entry
['author'] = bits
[1]
52 elif subject_wait
and line
.startswith(' '):
54 entry
['subject'] = line
.strip()
56 elif line
.startswith(' BugLink: ') and 'launchpad.net' in line
:
57 bits
= line
.strip().split(maxsplit
=1)
58 bits
= bits
[1].split('/')
59 entry
.setdefault('bugs', []).append(bits
[-1])
61 elif line
.startswith(' CVE-'):
62 entry
.setdefault('cves', []).append(line
.strip())
64 elif line
.startswith(' Ignore:'):
65 entry
['ignore'] = True
71 # Go through the entries and clear out authors for upstream commits.
73 if entry
['subject'].startswith('UBUNTU:'):
74 entry
['subject'] = entry
['subject'][7:].strip()
78 # Lump everything without a bug at the bottom.
79 keys
.append('__packaging__')
80 keys
.append('__mainline__')
84 if key
== '__packaging__':
85 title_set
= [ 'Miscellaneous Ubuntu changes' ]
86 elif key
== '__mainline__':
87 title_set
= [ 'Miscellaneous upstream changes' ]
91 if bug
.startswith('CVE-'):
97 #urllib.request.urlcleanup()
98 request
= urllib
.request
.Request('https://api.launchpad.net/devel/bugs/' + bug
)
99 request
.add_header('Cache-Control', 'max-age=0')
100 with urllib
.request
.urlopen(request
) as response
:
101 data
= response
.read()
102 bug_info
= json
.loads(data
.decode('utf-8'))
104 title
= bug_info
['title']
105 if 'description' in bug_info
:
106 for line
in bug_info
['description'].split('\n'):
107 if line
.startswith('Kernel-Description:'):
108 title
= line
.split(' ', 1)[1]
110 except urllib
.error
.HTTPError
:
111 title
= 'INVALID or PRIVATE BUG'
113 title
+= ' (LP###' + bug
+ ')'
114 title_set
.append(title
)
118 for entry
in entries
:
119 if entry
['key'] != key
:
127 title_lines
= textwrap
.wrap('#// '.join(title_set
), 76)
128 print(' * ' + title_lines
[0].replace('LP###', 'LP: #').replace('#//', ' //'))
129 for line
in title_lines
[1:]:
130 line
= line
.replace('LP###', 'LP: #').replace('#//', ' //')
135 title_lines
= textwrap
.wrap(entry
['subject'], 76)
136 print(' - ' + title_lines
[0])
137 for line
in title_lines
[1:]:
138 line
= line
.replace('LP###', 'LP: #')