-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapport-kernel-links
More file actions
executable file
·43 lines (37 loc) · 1.27 KB
/
apport-kernel-links
File metadata and controls
executable file
·43 lines (37 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash -eu
#
# Create apport hook links for public kernel packages
#
function lp_lookup_source()
{
local series=${1} source=${2}
python3 -c """
from launchpadlib.launchpad import Launchpad
lp = Launchpad.login_anonymously('tools', 'production', version='devel')
lp_distro = lp.distributions['ubuntu']
lp_archive = lp_distro.main_archive
lp_series = lp_distro.getSeries(name_or_version='${series}')
ps = lp_archive.getPublishedSources(exact_match=True,
status='Published',
distro_series=lp_series,
source_name='${source}')
if ps:
handle = '${series}/${source}'
print(f'{handle:<30} {ps[0]}')
"""
}
series=$1
ubuntu-kernel-info active -f series.name,package.name --pkg-format deb --pkg-type main | awk '$1 == "'"$1"'" { print $2 }' | while read -r source ; do
if [ -n "$(lp_lookup_source "$series" "${source}")" ] ; then
~/git/ubuntu/kteam-tools/cranky/cranky shell-helper source-packages-name -t "${series}:${source}" | while read -r t n ; do
if [ "$n" = "linux" ] ; then
continue
fi
case "$t" in
main|meta|signed|lrm)
echo "/usr/share/apport/package-hooks/source_linux.py /usr/share/apport/package-hooks/source_$n.py"
;;
esac
done
fi
done