Add --install and --ssh options to find-dbgsym-packages.
Suggest sudo and openssh-client.
Related to #935567.
Axel Beckert
4 years ago
7 | 7 |
* Bump debhelper compatibility level to 12.
|
8 | 8 |
+ Build-depend on "debhelper-compat (= 12)" to replace debian/compat.
|
9 | 9 |
* Declare compliance with Debian Policy 4.5.0. (No changes needed.)
|
|
10 |
* Add --install and --ssh options to find-dbgsym-packages. (See #935567)
|
|
11 |
+ Suggest sudo and openssh-client.
|
10 | 12 |
|
11 | 13 |
-- Axel Beckert <abe@debian.org> Sat, 18 Apr 2020 23:54:38 +0200
|
12 | 14 |
|
31 | 31 |
libgnome2-bin,
|
32 | 32 |
lsb-release,
|
33 | 33 |
lsof,
|
|
34 |
openssh-client,
|
|
35 |
sudo,
|
34 | 36 |
x-www-browser | www-browser,
|
35 | 37 |
xdg-utils
|
36 | 38 |
Conflicts: bikeshed,
|
|
70 | 72 |
find-dbgsym-packages
|
71 | 73 |
- Get list of dbgsym packages from core dump or PID [dctrl-tools,
|
72 | 74 |
elfutils, libfile-which-perl, libipc-system-simple-perl]
|
|
75 |
Usage of the --ssh option requires openssh-client.
|
73 | 76 |
popbugs - Display a customized release-critical bug list based on
|
74 | 77 |
packages you use (using popularity-contest data) [python3,
|
75 | 78 |
popularity-contest]
|
4 | 4 |
#
|
5 | 5 |
# Copyright (C) 2017 Stefan Fritsch <sf@debian.org>
|
6 | 6 |
# Copyright (C) 2017 Paul Wise <pabs@debian.org>
|
7 | |
# Copyright (C) 2017-2018 Axel Beckert <abe@debian.org>
|
|
7 |
# Copyright (C) 2017-2020 Axel Beckert <abe@debian.org>
|
8 | 8 |
# Copyright (C) 2018 Jakub Wilk <jwilk@jwilk.net>
|
9 | 9 |
#
|
10 | 10 |
# This program is free software; you can redistribute it and/or modify
|
|
35 | 35 |
}
|
36 | 36 |
|
37 | 37 |
my $vdso_regexp = qr/^linux-(gate|vdso\d*)[.]so[.]/;
|
|
38 |
my $call_apt = 0;
|
|
39 |
my $use_ssh = 0;
|
38 | 40 |
|
39 | 41 |
my %pkgs;
|
40 | 42 |
my @out_of_date_files;
|
41 | 43 |
foreach my $arg (@ARGV) {
|
|
44 |
if ($arg eq '--install') {
|
|
45 |
$call_apt = 1;
|
|
46 |
next;
|
|
47 |
}
|
|
48 |
if ($arg eq '--ssh') {
|
|
49 |
$use_ssh = 1;
|
|
50 |
next;
|
|
51 |
}
|
|
52 |
|
42 | 53 |
my %build_ids;
|
43 | 54 |
if ($arg =~ /^\d+$/) {
|
44 | 55 |
%build_ids = get_build_ids_from_pid($arg);
|
|
74 | 85 |
"W: they are not at the expected (usually older) package version.\n";
|
75 | 86 |
}
|
76 | 87 |
|
77 | |
say join(" ", sort keys %pkgs);
|
|
88 |
my @pkgs = sort keys %pkgs;
|
|
89 |
if (@pkgs) {
|
|
90 |
if ($call_apt) {
|
|
91 |
my @cmd = (qw(apt install --no-install-recommends), @pkgs);
|
|
92 |
unless ($> == 0) {
|
|
93 |
if ($use_ssh) {
|
|
94 |
@cmd = (qw(ssh root@localhost -t), @cmd);
|
|
95 |
} else {
|
|
96 |
if (which('sudo')) {
|
|
97 |
unshift(@cmd, 'sudo');
|
|
98 |
} else {
|
|
99 |
@cmd = (qw(su - -c), join(' ', @cmd));
|
|
100 |
}
|
|
101 |
}
|
|
102 |
}
|
|
103 |
exec(@cmd);
|
|
104 |
} else {
|
|
105 |
say join(" ", @pkgs);
|
|
106 |
}
|
|
107 |
} else {
|
|
108 |
warn "I: All needed dbgsym packages are already installed.\n";
|
|
109 |
}
|
78 | 110 |
|
79 | 111 |
exit 0;
|
80 | 112 |
|
|
296 | 328 |
{
|
297 | 329 |
print << "EOF";
|
298 | 330 |
usage:
|
299 | |
$0 <core file or PID> [ ... ]
|
|
331 |
$0 [--install] [--ssh] <core file or PID or program> [ ... ]
|
300 | 332 |
|
301 | 333 |
You must already have the correct debug lines in your sources.list and have
|
302 | 334 |
executed 'apt-get update'.
|
5 | 5 |
|
6 | 6 |
=head1 SYNOPSIS
|
7 | 7 |
|
8 | |
B<find-dbgsym-packages> I<executable, core file or PID> [I<executable, library, core file or PID> …]
|
|
8 |
B<find-dbgsym-packages> [I<options>] I<executable, core file or PID> [I<executable, library, core file or PID> …]
|
9 | 9 |
|
10 | 10 |
=head1 DESCRIPTION
|
11 | 11 |
|
|
24 | 24 |
|
25 | 25 |
Additionally, B<find-dbgsym-packages> requires the I<elfutils> and
|
26 | 26 |
I<dctrl-tools> packages to be installed.
|
|
27 |
|
|
28 |
=head1 OPTIONS
|
|
29 |
|
|
30 |
=over 4
|
|
31 |
|
|
32 |
=item C<--install>
|
|
33 |
|
|
34 |
Don't display the list of required dbgsym packages but directly use
|
|
35 |
L<apt(1)> to install them. If not being run as root and L<sudo(1)> is
|
|
36 |
installed, call C<sudo apt install ...>, else use C<su - -c "apt
|
|
37 |
install">.
|
|
38 |
|
|
39 |
=item C<--ssh>
|
|
40 |
|
|
41 |
Use C<ssh root@localhost -t> instead of C<sudo> or C<su - -c>. to gain
|
|
42 |
administrative privileges.
|
|
43 |
|
|
44 |
=back
|
27 | 45 |
|
28 | 46 |
=head1 EXAMPLES
|
29 | 47 |
|