]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - debian/scripts/misc/git-ubuntu-log
10 sys
.stdout
= codecs
.getwriter("utf-8")(sys
.stdout
.detach())
12 # Suck up the git log output and extract the information we need.
17 for line
in sys
.stdin
:
18 if line
.startswith('commit '):
19 if entry
and 'ignore' not in entry
:
24 elif line
.startswith('Author: '):
25 bits
= line
.strip().split(maxsplit
=1)
26 entry
['author'] = bits
[1]
28 elif subject_wait
and line
.startswith(' '):
30 entry
['subject'] = line
.strip()
32 elif line
.startswith(' BugLink: ') and 'launchpad.net' in line
:
33 bits
= line
.strip().split(maxsplit
=1)
34 bits
= bits
[1].split('/')
35 entry
.setdefault('bugs', []).append(bits
[-1])
37 # Accumulate bug numbers.
38 if bits
[-1] not in bugs
:
41 elif line
.startswith(' Ignore:'):
42 entry
['ignore'] = True
47 # Go through the entries and clear out authors for upstream commits.
49 if entry
['subject'].startswith('UBUNTU:'):
50 entry
['subject'] = entry
['subject'][7:].strip()
54 # Lump everything without a bug at the bottom.
55 bugs
.append('__packaging__')
56 bugs
.append('__mainline__')
60 if bug
== '__packaging__':
61 title
= 'Miscellaneous Ubuntu changes'
62 elif bug
== '__mainline__':
63 title
= 'Miscellaneous upstream changes'
68 #urllib.request.urlcleanup()
69 request
= urllib
.request
.Request('https://api.launchpad.net/devel/bugs/' + bug
)
70 request
.add_header('Cache-Control', 'max-age=0')
71 with urllib
.request
.urlopen(request
) as response
:
72 data
= response
.read()
73 bug_info
= json
.loads(data
.decode('utf-8'))
75 title
= bug_info
['title']
76 if 'description' in bug_info
:
77 for line
in bug_info
['description'].split('\n'):
78 if line
.startswith('Kernel-Description:'):
79 title
= line
.split(' ', 1)[1]
81 except urllib
.error
.HTTPError
:
82 title
= 'INVALID or PRIVATE BUG'
84 title
+= ' (LP: #' + bug
+ ')'
88 if (bug
== '__packaging__' and 'bugs' not in entry
and 'author' in entry
) or \
89 (bug
== '__mainline__' and 'bugs' not in entry
and 'author' not in entry
) or \
90 ('bugs' in entry
and bug
in entry
['bugs']):
98 print(' - ' + entry
['subject'])